Beispiel #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*");
        }
Beispiel #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*" );
        }
        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*" );
        }