public CivilizationFeatureResolver(CivilizationRegister register, WorldType worldTypeBase, WorldType worldTypeCiv, byte worldTypePlayerId = 255) { Register = register; //World type WorldTypeBase = worldTypeBase.Valid ? worldTypeBase : WorldType.Base; WorldTypeCiv = worldTypeCiv.Valid ? worldTypeCiv : WorldType.Civ; WorldTypeBoth = WorldTypeBase + WorldTypeCiv; if (worldTypePlayerId == 255) { for (byte i = 0; i < WorldTypeCiv.Size; i++) { if (WorldTypeCiv[i]) { WorldTypePlayerId = i; break; } } } else { WorldTypePlayerId = worldTypePlayerId; } if (!WorldTypeCiv[WorldTypePlayerId]) { throw new ArgumentException("Must be a valid player world", nameof(worldTypePlayerId)); } }
public Civilization(string name, CivilizationRegister register) { Name = name; Register = register; Key = new Key(register.Key, name); Index = -1; //this is done to avoid to make this civ not equal another civ with index 0 Index = Register.FreeIndex; Register.AddCivilisation(this); }
public CivilizationFeatureResolver(CivilizationRegister register) { Register = register; }
public CivilizationManager(CivilizationRegister register) { Register = register; }