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

◆ CalcAndSetTotalEnergy()

void CalcAndSetTotalEnergy ( )
protected

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

2602 {
2603 if (GetGame() && GetGame().IsServer())
2604 {
2605 m_TotalEnergy = 0;
2606
2607 foreach (FireConsumableType fireConsumableType : m_FireConsumableTypes)
2608 {
2609 string quantityConfigPath = string.Format("CfgVehicles %1 varQuantityMax", fireConsumableType.GetItemType().ToString());
2610 string stackMaxConfigPath = string.Format("CfgSlots Slot_%1 stackMax", fireConsumableType.GetAttSlot());
2611 if (GetGame().ConfigIsExisting(quantityConfigPath))
2612 {
2613 float quantityMax = GetGame().ConfigGetFloat(quantityConfigPath);
2614 }
2615
2616 if (GetGame().ConfigIsExisting(stackMaxConfigPath))
2617 {
2618 float stackMax = GetGame().ConfigGetFloat(stackMaxConfigPath);
2619 }
2620
2621 //debug
2622 //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() + "]");
2623
2624 if (stackMax > 0)
2625 {
2626 m_TotalEnergy += stackMax * fireConsumableType.GetEnergy();
2627 }
2628 else
2629 {
2630 m_TotalEnergy += quantityMax * fireConsumableType.GetEnergy();
2631 }
2632 }
2633
2634 //debug
2635 //Print("Total energy = " + m_TotalEnergy.ToString());
2636 }
2637 }
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().