public void Activate(string activator = "XANA") { var newactivator = LyokoParser.ParseActivator(activator.ToUpper()); if (!Activated) { if (newactivator == APIActivator.NONE) { return; } Activator = newactivator; TowerActivationEvent.Call(VirtualWorld.Name, Sector.Name, Number, newactivator.ToString()); } else { if (newactivator == APIActivator.NONE) { Deactivate(); return; } if (newactivator != Activator) { Hijack(newactivator.ToString()); } } }
public static void Call(string vworld, string sector, int number, string activator) { if ((IsLocked && !Assembly.GetCallingAssembly().Equals(Events.Master))) { return; } APITower tower = new APITower(vworld, sector, number); tower.Activator = LyokoParser.ParseActivator(activator); Call(tower); }
public void Hijack(string activator) { var newactivator = LyokoParser.ParseActivator(activator.ToUpper()); if (!Activated) { Activate(activator); } else if (newactivator == APIActivator.NONE) { Deactivate(); } else if (newactivator != Activator) { TowerHijackEvent.Call(new APITower(VirtualWorld.Name, Sector.Name, Number), newactivator, Activator); Activator = newactivator; } }