void nobBaseWarehouse::Serialize_nobBaseWarehouse(SerializedGameData& sgd) const { Serialize_nobBaseMilitary(sgd); sgd.PushObjectContainer(waiting_wares, true); sgd.PushBool(fetch_double_protection); sgd.PushObjectContainer(dependent_figures, false); sgd.PushObjectContainer(dependent_wares, true); sgd.PushObject(producinghelpers_event, true); sgd.PushObject(recruiting_event, true); sgd.PushObject(empty_event, true); sgd.PushObject(store_event, true); for(unsigned i = 0; i < 5; ++i) { // Nur das Reale, nicht das visuelle speichern, das wäre sinnlos!, beim Laden ist das visuelle = realem sgd.PushUnsignedInt(reserve_soldiers_available[i]); sgd.PushUnsignedInt(reserve_soldiers_claimed_real[i]); } for(unsigned i = 0; i < WARE_TYPES_COUNT; ++i) { sgd.PushUnsignedInt(inventory.visual.goods[i]); sgd.PushUnsignedInt(inventory.real.goods[i]); sgd.PushUnsignedChar(inventorySettings.wares[i].ToUnsignedChar()); } for(unsigned i = 0; i < JOB_TYPES_COUNT; ++i) { sgd.PushUnsignedInt(inventory.visual.people[i]); sgd.PushUnsignedInt(inventory.real.people[i]); sgd.PushUnsignedChar(inventorySettings.figures[i].ToUnsignedChar()); } }
void nobMilitary::Serialize_nobMilitary(SerializedGameData& sgd) const { Serialize_nobBaseMilitary(sgd); unsigned char bitfield = 0; if (new_built) { bitfield |= (1 << 0); } // reverse for compatibility :) if (!captured_not_built) { bitfield |= (1 << 1); } sgd.PushUnsignedChar(bitfield); sgd.PushUnsignedChar(coins); sgd.PushBool(coinsDisabled); sgd.PushBool(coinsDisabledVirtual); sgd.PushUnsignedChar(frontier_distance); sgd.PushUnsignedChar(size); sgd.PushBool(capturing); sgd.PushUnsignedInt(capturing_soldiers); sgd.PushObject(goldorder_event, true); sgd.PushObject(upgrade_event, true); sgd.PushObjectContainer(ordered_troops, true); sgd.PushObjectContainer(ordered_coins, true); sgd.PushObjectContainer(troops, true); sgd.PushObjectContainer(far_away_capturers, true); sgd.PushBool(mAutoTrain); sgd.PushBool(mAutoTrainVirtual); }