コード例 #1
0
        /********************************************************************************************/
        /********************************************************************************************/
        /***                                                                                      ***/
        /***                                     MAIN SETUP                                       ***/
        /***                                                                                      ***/
        /********************************************************************************************/
        /********************************************************************************************/

        //implements abstract rectangle interface: used to setup the initial information so that the agent has basic knowledge about the level
        public override void Setup(CountInformation nI, RectangleRepresentation rI, CircleRepresentation cI, ObstacleRepresentation[] oI, ObstacleRepresentation[] rPI, ObstacleRepresentation[] cPI, CollectibleRepresentation[] colI, Rectangle area, double timeLimit)
        {
            singlePlayer = new RectangleSingleplayer(cutplan, testing, timer);

            //check if it is a single or multiplayer level
            if (cI.X < 0 || cI.Y < 0)
            {
                //if the circle has negative position then this is a single player level
                gameMode = 0;
                singlePlayer.Setup(nI, rI, cI, oI, rPI, cPI, colI, area, timeLimit);
            }
            else
            {
                gameMode    = 1;
                multiPlayer = new RectangleCoopAgent(area, colI, oI, rPI, cPI, singlePlayer);
                multiPlayer.Setup(nI, rI, cI, oI, rPI, cPI, colI, area, timeLimit);
            }
        }
 public override void Setup(CountInformation nI, RectangleRepresentation rI, CircleRepresentation cI, ObstacleRepresentation[] oI, ObstacleRepresentation[] rPI, ObstacleRepresentation[] cPI, CollectibleRepresentation[] colI, Rectangle area, double timeLimit)
 {
     rectangleSingleplayer.Setup(nI, rI, cI, oI, rPI, cPI, objectiveDiamond, area, timeLimit);
     setup = true;
 }