public void DoNext(Player _player) { player = _player; if (group == null) { foreach (Group g in MyAI.arrGroup) { if (!g.hasGuard) { g.hasGuard = true; group = g; g.Guard = this; break; } } } if (group == null) // kalo masih null juga -> bot baru dibuat setelah salah satu hancur { foreach (NanoBot bot in _player.NanoBots) { if (bot is GuardBot) { ((GuardBot)bot).group = null; } } foreach (Group g in MyAI.arrGroup) { g.Guard = null; g.hasGuard = false; } return; } HandleEnemies(); HandleDestinationChange(); if (this.State == NanoBotState.WaitingOrders) { this.GuardState = GuardBotState.idle; this.MoveTo(Global.PF.FindWay(this.Location, group.ActiveDestination).Points); } }
public void DoNext(Player _player) { player = _player; if (group == null) { foreach (Group g in MyAI.arrGroup) { if (!g.hasGuard) { g.hasGuard = true; group = g; g.Guard = this; break; } } } if (group == null) // kalo masih null juga -> bot baru dibuat setelah salah satu hancur { foreach (NanoBot bot in _player.NanoBots) { if (bot is GuardBot) { ((GuardBot)bot).group = null; } } foreach (Group g in MyAI.arrGroup) { g.Guard = null; g.hasGuard = false; } return; } HandleEnemies(); HandleDestinationChange(); if (this.State == NanoBotState.WaitingOrders) { this.GuardState = GuardBotState.idle; this.MoveTo(Global.PF.FindWay(this.Location, group.ActiveDestination).Points); } }