public RectangleSingleplayerRule(CollectibleRepresentation objectiveDiamond) : base()
        {
            this.rectangleSingleplayer = new RectangleSingleplayer(true, true, true);

            this.objectiveDiamond = new CollectibleRepresentation[1];

            this.objectiveDiamond[0] = objectiveDiamond;

            setup = false;
        }
Beispiel #2
0
        public RectangleCoopAgent(Rectangle area, CollectibleRepresentation[] diamonds, ObstacleRepresentation[] platforms, ObstacleRepresentation[] rectanglePlatforms, ObstacleRepresentation[] circlePlatforms, RectangleSingleplayer rectangleSingleplayer)
        {
            coopRules = new CoopRules(area, diamonds, platforms, rectanglePlatforms, circlePlatforms);

            this.rectangleSingleplayer = rectangleSingleplayer;

            currentRuleTime = new TimeSpan(0);

            finished = false;

            currentAction = 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);
            }
        }