Exemplo n.º 1
0
        public Game(int mapSize)
        {
            // Generate map
            this.gameMap = new Map(mapSize);

            // Generate rovers

            this.roverList = new List <Rover>();

            roverList.Add(new Rover("Opportunity"));
            roverList[0].Place(Convert.ToInt32(mapSize / 2), Convert.ToInt32(mapSize / 2), gameMap);

            roverList.Add(new Rover("Spirit"));
            roverList[1].Place(Convert.ToInt32(mapSize / 3), Convert.ToInt32(mapSize / 3), gameMap);

            this.selectedRover = roverList[0];

            // Generate batteries

            this.batteryList = new List <Battery>();

            batteryList.Add(new Battery(1));
            batteryList.Add(new Battery(2));
            batteryList.Add(new Battery(3));

            // Generate devices
            // Generate motors

            this.motorList = new List <Motor>();

            motorList.Add(new Motor("RotoPro 10X"));
            motorList.Add(new Motor("Kawasaki Wanderer"));

            // Generate drills

            this.drillList = new List <Drill>();

            drillList.Add(new Drill("Drillmaster X"));

            // Generate solar panels

            this.solarPanelList = new List <SolarPanel>();

            solarPanelList.Add(new SolarPanel("SunFriend"));

            // Generate Radars

            this.radarList = new List <Radar>();

            radarList.Add(new LocationRadar("Where 5i"));
            radarList.Add(new SizeRadar("SeeBiggy"));
            radarList.Add(new NameRadar("NomSeek"));

            // Add devices to Rovers

            roverList[0].LoadBattery(batteryList[0]);
            roverList[0].LoadBattery(batteryList[2]);
            roverList[0].AttachDevice(motorList[0]);
            roverList[0].AttachBattery(batteryList[0], motorList[0]);

            roverList[1].LoadBattery(batteryList[1]);
            roverList[1].AttachDevice(motorList[1]);
            roverList[1].AttachBattery(batteryList[1], motorList[1]);

            // Add specimens to map

            this.specimenList = new List <Specimen>();

            specimenList.Add(new Specimen("John: Rock", 5));
            specimenList.Add(new Specimen("John: Dust", 2));
            specimenList.Add(new Specimen("Elizabeth: Rock", 6));
            specimenList.Add(new Specimen("Elizabeth: Possible Fossil", 8));
            specimenList.Add(new Specimen("Elizabeth: Water", 3));
            specimenList.Add(new Specimen("Milo: Rock", 5));
            specimenList.Add(new Specimen("Milo: Abandoned Rover", 120));
            specimenList.Add(new Specimen("Milo: Dust", 2));
            specimenList.Add(new Specimen("Svetlana: Scraping", 2));
            specimenList.Add(new Specimen("Svetlana: Dust", 2));

            this.gameMap.PlaceSpecimen(this.specimenList);
        }
Exemplo n.º 2
0
 public Device(String name)
 {
     this.name    = name;
     this.battery = null;
     this.rover   = null;
 }
Exemplo n.º 3
0
 public Battery(int serial)
 {
     this.charge = 100;
     this.serial = serial;
     this.rover  = null;
 }