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 void Activate(APIActivator activator) { if (!Activated && activator != APIActivator.NONE) { Activator = activator; TowerActivationEvent.Call(this); } }
internal void Activate(APIActivator activator = APIActivator.XANA) { if (Activated) { return; // for APITower, Activated checks if the activator isn't NONE } this.Activator = Activator; //assign activator first TowerActivationEvent.Call(this); //call event second }
public void Activate(string activator) { if (Activated) { return; } if (!PossibleActivators.Contains(activator.ToLower())) { return; } Activator = activator; TowerActivationEvent.Call("lyoko", Sector, Number, Activator); //you can call the event with only strings, using the info from your class. //This will also give 0 control over this class to the listeners. }