コード例 #1
0
ファイル: PetrolBot.cs プロジェクト: tsgardiner/IN710gardits1
        public PetrolBot(Graphics botCanvas, Color botColour, Point botLocation, int botSize, Ship ship)
        {
            this.botCanvas = botCanvas;
            this.botColour = botColour;
            this.botLocation = botLocation;
            this.waitingLocation = botLocation;
            this.botSize = botSize;

            botBrush = new SolidBrush(botColour);

            this.botShip = ship;

            Ship.OutOfFuelEvent outOfFuelHandler = new Ship.OutOfFuelEvent(OutOfFuelHandler);
            Ship.FullOfFuelEvent fullOfFuelHandler = new Ship.FullOfFuelEvent(FullOfFuelHandler);

            ship.outOfFuel += outOfFuelHandler;
            ship.fullOfFuel += fullOfFuelHandler;
        }
コード例 #2
0
ファイル: PetrolBot.cs プロジェクト: tsgardiner/IN710gardits1
        public PetrolBot(Graphics botCanvas, Color botColour, Point botLocation, int botSize, Ship ship)
        {
            this.botCanvas       = botCanvas;
            this.botColour       = botColour;
            this.botLocation     = botLocation;
            this.waitingLocation = botLocation;
            this.botSize         = botSize;

            botBrush = new SolidBrush(botColour);

            this.botShip = ship;

            Ship.OutOfFuelEvent  outOfFuelHandler  = new Ship.OutOfFuelEvent(OutOfFuelHandler);
            Ship.FullOfFuelEvent fullOfFuelHandler = new Ship.FullOfFuelEvent(FullOfFuelHandler);

            ship.outOfFuel  += outOfFuelHandler;
            ship.fullOfFuel += fullOfFuelHandler;
        }