Exemplo n.º 1
0
        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);
 }
Exemplo n.º 3
0
 public CivilizationFeatureResolver(CivilizationRegister register)
 {
     Register = register;
 }
Exemplo n.º 4
0
 public CivilizationManager(CivilizationRegister register)
 {
     Register = register;
 }