public virtual void SwitchOn(Sense.Type type) { Sense sense = Root.Instance.SenseManager.GetSense(type); if (sense != null) { sense.On(this); } }
public Sense GetSense(Sense.Type type) { lock(senses) { if (senses.ContainsKey(type)) { return senses[type]; } } return null; }
public void Toggle(Sense.Type type) { Sense sense = Root.Instance.SenseManager.GetSense(type); if (sense == null) { return; } if (sense.Active) { sense.On(this); } else { sense.Off(this); } }
private void SwitchMusic(Sense sense) { if (sense == Sense.down) { if (currentIndex < musicas.Count-1) { currentIndex++; } } else { if (currentIndex > 0) { currentIndex--; } } ActivateMusic(); }
public override void HandleSense(Sense sense) { if (sense.AgentSensed.GetType() == typeof(Sheriff)) Say(string.Format("Hello Sheriff:{0}! ", sense.AgentSensed.Id)); }
public override void HandleSense(Sense sense) { throw new NotImplementedException(); }