public void LoadDBData(DBBaseLegionStationed data) { if (data == null) { return; } DefendCastle = GetEntity <TCastle>(data.DefendCastle); PreDefendCastle = GetEntity <TCastle>(data.PreDefendCastle); SiegeCastle = GetEntity <TCastle>(data.SiegeCastle); PreSiegeCastle = GetEntity <TCastle>(data.PreSiegeCastle); }
public DBBaseLegionStationed GetDBData() { DBBaseLegionStationed ret = new DBBaseLegionStationed(); if (DefendCastle) { ret.DefendCastle = DefendCastle.ID; } if (PreDefendCastle) { ret.PreDefendCastle = PreDefendCastle.ID; } if (SiegeCastle) { ret.SiegeCastle = SiegeCastle.ID; } if (PreSiegeCastle) { ret.PreSiegeCastle = PreSiegeCastle.ID; } return(ret); }