Esempio n. 1
0
        public TankController(Dictionary <int, IUnitDef> UnitDefsById, IUnitDef typicalunitdef)
        {
            csai       = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile    = LogFile.GetInstance();

            this.DefsById       = UnitDefsById;
            this.typicalunitdef = typicalunitdef;

            unitcontroller  = UnitController.GetInstance();
            enemycontroller = EnemyController.GetInstance();
            buildtable      = BuildTable.GetInstance();

            enemyselector = new EnemySelector2(typicalunitdef.speed * 2, typicalunitdef);
            // speed here is experimental

            attackpackcoordinator       = new AttackPackCoordinator(DefsById);
            spreadsearchpackcoordinator = new SpreadSearchPackCoordinator(DefsById);
            movetopackcoordinator       = new MoveToPackCoordinator(DefsById);
            guardpackcoordinator        = new GuardPackCoordinator(DefsById);

            packcoordinatorselector = new PackCoordinatorSelector();
            packcoordinatorselector.LoadCoordinator(attackpackcoordinator);
            packcoordinatorselector.LoadCoordinator(spreadsearchpackcoordinator);
            packcoordinatorselector.LoadCoordinator(movetopackcoordinator);
            packcoordinatorselector.LoadCoordinator(guardpackcoordinator);

            logfile.WriteLine("*TankController Initialized*");
        }
Esempio n. 2
0
        public TankController(IPlayStyle playstyle)
        {
            this.playstyle = playstyle;

            csai       = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile    = LogFile.GetInstance();

            unitdefhelp     = new UnitDefHelp(aicallback);
            unitcontroller  = UnitController.GetInstance();
            enemycontroller = EnemyController.GetInstance();
            buildtable      = BuildTable.GetInstance();

            enemyselector = new EnemySelector(110, false, false);

            attackpackcoordinator       = new AttackPackCoordinator(TankDefsById);
            spreadsearchpackcoordinator = new SpreadSearchPackCoordinator(TankDefsById);
            movetopackcoordinator       = new MoveToPackCoordinator(TankDefsById);
            guardpackcoordinator        = new GuardPackCoordinator(TankDefsById);

            packcoordinatorselector = new PackCoordinatorSelector();
            packcoordinatorselector.LoadCoordinator(attackpackcoordinator);
            packcoordinatorselector.LoadCoordinator(spreadsearchpackcoordinator);
            packcoordinatorselector.LoadCoordinator(movetopackcoordinator);
            packcoordinatorselector.LoadCoordinator(guardpackcoordinator);

            logfile.WriteLine("*TankController Initialized*");
        }
        public TankController( Dictionary< int,IUnitDef>UnitDefsById, IUnitDef typicalunitdef)
        {
            csai = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile = LogFile.GetInstance();

            this.DefsById = UnitDefsById;
            this.typicalunitdef = typicalunitdef;
            
            unitcontroller = UnitController.GetInstance();
            enemycontroller = EnemyController.GetInstance();
            buildtable = BuildTable.GetInstance();

            enemyselector = new EnemySelector2( typicalunitdef.speed * 2, typicalunitdef );
            // speed here is experimental

            attackpackcoordinator = new AttackPackCoordinator(DefsById);
            spreadsearchpackcoordinator = new SpreadSearchPackCoordinator(DefsById);
            movetopackcoordinator = new MoveToPackCoordinator(DefsById);
            guardpackcoordinator = new GuardPackCoordinator(DefsById);
            
            packcoordinatorselector = new PackCoordinatorSelector();
            packcoordinatorselector.LoadCoordinator( attackpackcoordinator );
            packcoordinatorselector.LoadCoordinator( spreadsearchpackcoordinator );
            packcoordinatorselector.LoadCoordinator( movetopackcoordinator );
            packcoordinatorselector.LoadCoordinator( guardpackcoordinator );

            logfile.WriteLine( "*TankController Initialized*" );
        }
Esempio n. 4
0
        public ScoutControllerRandomSearch(IPlayStyle playstyle)
        {
            random = new Random();

            this.playstyle = playstyle;

            csai       = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile    = LogFile.GetInstance();

            unitcontroller = UnitController.GetInstance();
            buildtable     = BuildTable.GetInstance();

            searchcoordinator = new SpreadSearchPackCoordinator(ScoutUnitDefsById);

            logfile.WriteLine("*ScoutController initialized*");
        }
        public ScoutControllerRandomSearch( IPlayStyle playstyle )
        {
            random = new Random();

            this.playstyle = playstyle;

            csai = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile = LogFile.GetInstance();

            unitcontroller = UnitController.GetInstance();
            buildtable = BuildTable.GetInstance();

            searchcoordinator = new SpreadSearchPackCoordinator( ScoutUnitDefsById );

            logfile.WriteLine( "*ScoutController initialized*" );
        }
Esempio n. 6
0
        public ScoutControllerRaider(IPlayStyle playstyle)
        {
            this.playstyle = playstyle;

            csai       = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile    = LogFile.GetInstance();

            random = new Random();

            terrainwidth  = aicallback.GetMapWidth() * MovementMaps.SQUARE_SIZE;
            terrainheight = aicallback.GetMapHeight() * MovementMaps.SQUARE_SIZE;

            int[,] sectorlastcheckedtickcount = new int[terrainwidth, terrainheight];
            bool[,] sectorispriority          = new bool[terrainwidth, terrainheight];;

            unitcontroller  = UnitController.GetInstance();
            buildtable      = BuildTable.GetInstance();
            enemycontroller = EnemyController.GetInstance();

            searchcoordinator = new SpreadSearchPackCoordinator(ScoutUnitDefsById);

            logfile.WriteLine("*ScoutControllerRaider initialized*");
        }
        public TankController( IPlayStyle playstyle )
        {
            this.playstyle = playstyle;

            csai = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile = LogFile.GetInstance();

            unitdefhelp = new UnitDefHelp( aicallback );
            unitcontroller = UnitController.GetInstance();
            enemycontroller = EnemyController.GetInstance();
            buildtable = BuildTable.GetInstance();

            enemyselector = new EnemySelector( 110, false, false );

            attackpackcoordinator = new AttackPackCoordinator( TankDefsById );
            spreadsearchpackcoordinator = new SpreadSearchPackCoordinator( TankDefsById );
            movetopackcoordinator = new MoveToPackCoordinator( TankDefsById );
            guardpackcoordinator = new GuardPackCoordinator( TankDefsById );

            packcoordinatorselector = new PackCoordinatorSelector();
            packcoordinatorselector.LoadCoordinator( attackpackcoordinator );
            packcoordinatorselector.LoadCoordinator( spreadsearchpackcoordinator );
            packcoordinatorselector.LoadCoordinator( movetopackcoordinator );
            packcoordinatorselector.LoadCoordinator( guardpackcoordinator );

            logfile.WriteLine( "*TankController Initialized*" );
        }
Esempio n. 8
0
        public ScoutControllerRaider( IPlayStyle playstyle )
        {
            this.playstyle = playstyle;

            csai = CSAI.GetInstance();
            aicallback = csai.aicallback;
            logfile = LogFile.GetInstance();

            random = new Random();

            terrainwidth = aicallback.GetMapWidth() * MovementMaps.SQUARE_SIZE;
            terrainheight = aicallback.GetMapHeight() * MovementMaps.SQUARE_SIZE;

            int[,] sectorlastcheckedtickcount = new int[ terrainwidth, terrainheight ];
            bool[,] sectorispriority = new bool[ terrainwidth, terrainheight ];;

            unitcontroller = UnitController.GetInstance();
            buildtable = BuildTable.GetInstance();
            enemycontroller = EnemyController.GetInstance();

            searchcoordinator = new SpreadSearchPackCoordinator( ScoutUnitDefsById );

            logfile.WriteLine( "*ScoutControllerRaider initialized*" );
        }