Beispiel #1
0
    public virtual void SwitchOn(Sense.Type type)
    {
        Sense sense = Root.Instance.SenseManager.GetSense(type);

        if (sense != null)
        {
            sense.On(this);
        }
    }
Beispiel #2
0
    public Sense GetSense(Sense.Type type)
    {
        lock(senses)
        {
            if (senses.ContainsKey(type))
            {
                return senses[type];
            }
        }

        return null;
    }
Beispiel #3
0
    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);
        }
    }
Beispiel #4
0
 private void SwitchMusic(Sense sense)
 {
     if (sense == Sense.down)
     {
         if (currentIndex < musicas.Count-1)
         {
             currentIndex++;
         }
     }
     else
     {
         if (currentIndex > 0)
         {
             currentIndex--;
         }
     }
     ActivateMusic();
 }
Beispiel #5
0
 public override void HandleSense(Sense sense)
 {
     if (sense.AgentSensed.GetType() == typeof(Sheriff))
         Say(string.Format("Hello Sheriff:{0}! ", sense.AgentSensed.Id));
 }
Beispiel #6
0
 public override void HandleSense(Sense sense)
 {
     throw new NotImplementedException();
 }