DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CalcAndSetTotalEnergy()

void CalcAndSetTotalEnergy ( )
protected

См. определение в файле FireplaceBase.c строка 2618

2619 {
2620 if (GetGame() && GetGame().IsServer())
2621 {
2622 m_TotalEnergy = 0;
2623
2624 foreach (FireConsumableType fireConsumableType : m_FireConsumableTypes)
2625 {
2626 string quantityConfigPath = string.Format("CfgVehicles %1 varQuantityMax", fireConsumableType.GetItemType().ToString());
2627 string stackMaxConfigPath = string.Format("CfgSlots Slot_%1 stackMax", fireConsumableType.GetAttSlot());
2628 if (GetGame().ConfigIsExisting(quantityConfigPath))
2629 {
2630 float quantityMax = GetGame().ConfigGetFloat(quantityConfigPath);
2631 }
2632
2633 if (GetGame().ConfigIsExisting(stackMaxConfigPath))
2634 {
2635 float stackMax = GetGame().ConfigGetFloat(stackMaxConfigPath);
2636 }
2637
2638 //debug
2639 //Print(fireConsumableType.GetItemType().ToString() + " quantityMax = " + quantityMax.ToString() + " [" + (quantity_max*fire_consumable_type.GetEnergy()).ToString() + "] | stack_max = " + stack_max.ToString() + " [" + (stack_max*fire_consumable_type.GetEnergy()).ToString() + "]");
2640
2641 if (stackMax > 0)
2642 {
2643 m_TotalEnergy += stackMax * fireConsumableType.GetEnergy();
2644 }
2645 else
2646 {
2647 m_TotalEnergy += quantityMax * fireConsumableType.GetEnergy();
2648 }
2649 }
2650
2651 //debug
2652 //Print("Total energy = " + m_TotalEnergy.ToString());
2653 }
2654 }
float quantityMax
Определения CfgPlayerSpawnDataJson.c:209
static ref map< typename, ref FireConsumableType > m_FireConsumableTypes
Определения FireplaceBase.c:142
float m_TotalEnergy
Определения FireplaceBase.c:212
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native CGame GetGame()

Перекрестные ссылки CGame::ConfigGetFloat(), GetGame(), m_FireConsumableTypes, m_TotalEnergy и quantityMax.

Используется в FireplaceBase().