Ejemplo n.º 1
0
        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());
                }
            }
        }
Ejemplo n.º 2
0
 public void Activate(APIActivator activator)
 {
     if (!Activated && activator != APIActivator.NONE)
     {
         Activator = activator;
         TowerActivationEvent.Call(this);
     }
 }
Ejemplo n.º 3
0
 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
 }
Ejemplo n.º 4
0
        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.
        }