Ejemplo n.º 1
0
 public bool IsFiveStar(Tower tower)
 {
     //metro
     return(tower.Population >= fiveStarPopulation);
 }
Ejemplo n.º 2
0
 public bool IsTower(Tower tower)
 {
     //is cathedral on top floor
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public bool IsFourStar(Tower tower)
 {
     //Maybe move to tower
     //recycling center, medical center, 2 suties, vip favorable rating
     return(tower.Population >= fourStarPopulation);
 }
Ejemplo n.º 4
0
        //properties ratings
        //calculate each rating
        //what qualifies for rating

        public bool IsTwoStar(Tower tower)
        {
            return(tower.Population >= twoStarPopulation);
        }
Ejemplo n.º 5
0
 public bool BuildStuff(int floorNumber, Range range, StructureTypes structure, bool existingFloor, Tower tower)
 {
     if (structure is StructureTypes.Lobby || structure is StructureTypes.Floor)
     {
         return(BuildFloor(range, floorNumber, structure, existingFloor, tower) != null);
     }
     if (structure is StructureTypes.StairCase)
     {
         return(BuildStairs(floorNumber, tower));
     }
     if (structure is StructureTypes.Elevator)
     {
         return(BuildElevator(range.StartX, floorNumber, tower.Floors[floorNumber]));
     }
     return(BuildRoom(structure, range, floorNumber, existingFloor, tower));
 }
Ejemplo n.º 6
0
        public IFloor BuildFloor(Range range, int floorNumber, StructureTypes structure, bool existingFloor, Tower tower)
        {
            IFloor floor;

            if (existingFloor)
            {
                floor = tower.Floors[floorNumber];
                var oldRange = tower.Floors[floorNumber].Range;
                var newRange = floor.GetExtendedFloorRange(range);
                floor.ExtendRange(newRange);
            }
            else
            {
                switch (structure)
                {
                case StructureTypes.Floor:

                    floor = new Floor(range);
                    break;

                case StructureTypes.Lobby:

                    floor = new Lobby(range.StartX);
                    break;

                default:
                    floor = null;
                    break;
                }
                tower.AddFloor(floor);
            }
            return(floor);
        }
Ejemplo n.º 7
0
        public bool BuildRoom(StructureTypes structure, Range range, int floorNumber, bool existingFloor, Tower tower)
        {
            //But, . . .only Floors can have rooms
            IFloor floor;

            var room = GetRoom(structure, range.StartX, floorNumber);

            floor = BuildFloor(range, floorNumber, StructureTypes.Floor, existingFloor, tower);

            ((Floor)floor).AddRoom(room);

            tower.UpdatePopulation(room.Population);
            //needs to be evaluated if stairs are created also.
            room.SetOccupancy(tower, floorNumber);


            return(true);
        }