public void Hijack(APIActivator newActivator) { if (Activated && newActivator != APIActivator.NONE) { APIActivator oldActivator = Activator; Activator = newActivator; TowerHijackEvent.Call(this, oldActivator, newActivator); } }
internal void Hijack(APIActivator newActivator) { if (!Activated) { return; } if (Activator.Equals(newActivator)) { return; } APIActivator old = Activator; //the event doesn't change the activator for you Activator = newActivator; //the ol' switcheroo TowerHijackEvent.Call(this, old, newActivator); }
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; } }