Beispiel #1
0
    // Initializes a planet.
    public Planet(int planetID,
                  int owner,
                  int numShips,
                  int growthRate,
                  double x,
                  double y)
    {
        this.planetID          = planetID;
        this.owner             = owner;
        this.numShips          = numShips;
        ShipCountAtStartOfTurn = numShips;
        this.growthRate        = growthRate;
        this.x = x;
        this.y = y;
        MaxDesertersAllowed = -1;
        IsMine    = owner == 1;
        IsNeutral = owner == 0;
        IsEnemy   = !IsMine && !IsNeutral;

        Armada = new PlanetArmada(this);

        CanSurviveIncommingAttack = true;
        AttackMovesAllowed        = true;
    }
    // Initializes a planet.
    public Planet(int planetID,
        int owner,
        int numShips,
        int growthRate,
        double x,
        double y)
    {
        this.planetID = planetID;
        this.owner = owner;
        this.numShips = numShips;
        ShipCountAtStartOfTurn = numShips;
        this.growthRate = growthRate;
        this.x = x;
        this.y = y;
        MaxDesertersAllowed = -1;
        IsMine = owner == 1;
        IsNeutral = owner == 0;
        IsEnemy = !IsMine && !IsNeutral;

        Armada = new PlanetArmada(this);

        CanSurviveIncommingAttack = true;
        AttackMovesAllowed = true;
    }