public void Activate() { if (!Active) { factorycontroller = playstyle.GetFirstControllerOfType(typeof(IFactoryController)) as IFactoryController; factorycontroller.RegisterRequester(this); enemycontroller.NewEnemyAddedEvent += new EnemyController.NewEnemyAddedHandler(EnemyAdded); enemycontroller.EnemyRemovedEvent += new EnemyController.EnemyRemovedHandler(EnemyRemoved); csai.TickEvent += new CSAI.TickHandler(Tick); csai.UnitIdleEvent += new CSAI.UnitIdleHandler(UnitIdle); csai.RegisterVoiceCommand("tankscount", new CSAI.VoiceCommandHandler(VoiceCommandCountTanks)); csai.RegisterVoiceCommand("tanksmoveto", new CSAI.VoiceCommandHandler(VoiceCommandMoveTo)); csai.RegisterVoiceCommand("tanksattackpos", new CSAI.VoiceCommandHandler(VoiceCommandAttackPos)); // unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler(UnitRemoved); TankDefsById.Clear(); // note, dont just make a new one, because searchpackcoordinator wont get new one unitcontroller.RefreshMyMemory(new UnitController.UnitAddedHandler(UnitAdded)); //PackCoordinatorSelector.Activate(); Active = true; } }
public void Activate() { if (!Active) { factorycontroller = playstyle.GetFirstControllerOfType(typeof(IFactoryController)) as IFactoryController; factorycontroller.RegisterRequester(this); csai.TickEvent += new CSAI.TickHandler(Tick); csai.RegisterVoiceCommand("countscouts", new CSAI.VoiceCommandHandler(VoiceCommandCountScouts)); enemycontroller.NewEnemyAddedEvent += new EnemyController.NewEnemyAddedHandler(EnemyAdded); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler(UnitAdded); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler(UnitRemoved); ScoutUnitDefsById.Clear(); // note, dont just make a new one, because searchpackcoordinator wont get new one unitcontroller.RefreshMyMemory(new UnitController.UnitAddedHandler(UnitAdded)); searchcoordinator.Activate(); Active = true; } }
public void Activate() { if( !Active ) { factorycontroller = playstyle.GetFirstControllerOfType( typeof( IFactoryController ) ) as IFactoryController; factorycontroller.RegisterRequester( this ); csai.TickEvent += new CSAI.TickHandler( Tick ); csai.RegisterVoiceCommand( "countscouts", new CSAI.VoiceCommandHandler( VoiceCommandCountScouts ) ); enemycontroller.NewEnemyAddedEvent += new EnemyController.NewEnemyAddedHandler( EnemyAdded ); unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler( UnitRemoved ); ScoutUnitDefsById.Clear(); // note, dont just make a new one, because searchpackcoordinator wont get new one unitcontroller.RefreshMyMemory( new UnitController.UnitAddedHandler( UnitAdded ) ); searchcoordinator.Activate(); Active = true; } }
public void Activate() { if( !Active ) { factorycontroller = playstyle.GetFirstControllerOfType( typeof( IFactoryController ) ) as IFactoryController; factorycontroller.RegisterRequester( this ); enemycontroller.NewEnemyAddedEvent += new EnemyController.NewEnemyAddedHandler( EnemyAdded ); enemycontroller.EnemyRemovedEvent += new EnemyController.EnemyRemovedHandler( EnemyRemoved ); csai.TickEvent += new CSAI.TickHandler( Tick ); csai.UnitIdleEvent += new CSAI.UnitIdleHandler( UnitIdle ); csai.RegisterVoiceCommand( "tankscount", new CSAI.VoiceCommandHandler( VoiceCommandCountTanks ) ); csai.RegisterVoiceCommand( "tanksmoveto", new CSAI.VoiceCommandHandler( VoiceCommandMoveTo ) ); csai.RegisterVoiceCommand( "tanksattackpos", new CSAI.VoiceCommandHandler( VoiceCommandAttackPos ) ); // unitcontroller.UnitAddedEvent += new UnitController.UnitAddedHandler( UnitAdded ); unitcontroller.UnitRemovedEvent += new UnitController.UnitRemovedHandler( UnitRemoved ); TankDefsById.Clear(); // note, dont just make a new one, because searchpackcoordinator wont get new one unitcontroller.RefreshMyMemory( new UnitController.UnitAddedHandler( UnitAdded ) ); //PackCoordinatorSelector.Activate(); Active = true; } }