| 133 | |
| 134 | |
| 135 | bool cFurnaceEntity::LoadFromJson(const Json::Value & a_Value) |
| 136 | { |
| 137 | m_PosX = a_Value.get("x", 0).asInt(); |
| 138 | m_PosY = a_Value.get("y", 0).asInt(); |
| 139 | m_PosZ = a_Value.get("z", 0).asInt(); |
| 140 | |
| 141 | Json::Value AllSlots = a_Value.get("Slots", 0); |
| 142 | int SlotIdx = 0; |
| 143 | for (Json::Value::iterator itr = AllSlots.begin(); itr != AllSlots.end(); ++itr) |
| 144 | { |
| 145 | cItem Item; |
| 146 | Item.FromJson(*itr); |
| 147 | SetSlot(SlotIdx, Item); |
| 148 | SlotIdx++; |
| 149 | } |
| 150 | |
| 151 | m_NeedCookTime = (int)(a_Value.get("CookTime", 0).asDouble() / 50); |
| 152 | m_TimeCooked = (int)(a_Value.get("TimeCooked", 0).asDouble() / 50); |
| 153 | m_FuelBurnTime = (int)(a_Value.get("BurnTime", 0).asDouble() / 50); |
| 154 | m_TimeBurned = (int)(a_Value.get("TimeBurned", 0).asDouble() / 50); |
| 155 | |
| 156 | return true; |
| 157 | } |
| 158 | |
| 159 | |
| 160 | |