public virtual void Deact() { for (int i = 0; i < reactorList.Count; i++) { Reactor r = reactorList[i]; r.Deact(); } }
public virtual void Dewit() //THIS IS WHAT THE AFFECTER WILL PERFORM EVERY TURN, IF ACTIVE { vitality += vRate; //UPDATE VITALITY for (int i = 0; i < interactorList.Count; i++) //FOR EACH INTERACTOR IN THE LIST { Affecter interactor = interactorList.ElementAt(i); //FOR EACH INTERACTOR IN THE LIST if (!(interactor).IsPresent()) //IF THE INTERACTOR ISN'T ALIVE { interactorList.Remove(interactor); //DELET THIS continue; //IGNORE THE REST OF THE POTENTIAL INTERACTION WITH THIS INTERACTOR } if (layered && interactor.IsLayered()) //IF BOTH AFFECTERS ACT AS LAYERS { if (Mathf.Abs(targetBody.GetLayerVal(interactor) - targetBody.GetLayerVal(this)) > 1) //IF THE INTERACTOR ISN'T ONE LAYER BENEATH OR ABOVE { continue; //CEASE THE INTERACTION } } for (int j = 0; j < reactorList.Count; j++) //FOR EACH REACTOR IN THE REACTOR LIST { Reactor reactor = reactorList.ElementAt(j); //FOR EACH REACTOR IN THE REACTOR LIST if (reactor.vitality <= 0) //IF THE REACTOR IS DEAD { if (!reactor.IsImmortal()) //LIKE... DEAD { reactor.Deact(); //DELETE REACTOR if (reactor.IsVital()) //IF THE REACTOR IS VITAL { present = false; //DESTROY THE AFFECTER TO WHICH THE REACTOR IS ATTACHED return; } } else //IF THE REACTOR IS STILL ALIVE { reactor.FindMatches(interactor); //HANDLE ANY INTERACTIONS IT MIGHT HAVE WITH THE INTERACTOR } } } } }