Esempio n. 1
0
    public override void use(AnimalSystem selection, int index)
    {
        if (shelter.empty())
        {
            return;
        }

        var swap_to = -1;

        switch (direction)
        {
        case Direction.Right:
            swap_to = ms.LookDirIndex > 0 ?
                      decrement(index, shelter.Count) :
                      increment(index, shelter.Count);
            break;

        case Direction.Left:
            swap_to = ms.LookDirIndex > 0 ?
                      increment(index, shelter.Count) :
                      decrement(index, shelter.Count);
            break;

        default:     // On error, just return
            return;
        }

        shelter.swap(index, swap_to);
        care_state.set_current_selection_index(swap_to);
    }
Esempio n. 2
0
 public void on_leaving(AnimalSystem animal)
 {
     if (animals.already_adopted(animal))
     {
         return;
     }
     animals_around_player.Remove(animal);
     refresh_close_animals();
 }
Esempio n. 3
0
 public virtual void use(AnimalSystem selection, int index)
 {
     Debug.Log("Using...");
 }
Esempio n. 4
0
 private bool can_eat(AnimalSystem neighbour)
 {
     return(neighbour.GetType() != typeof(Wolf) &&
            neighbour.GetType() != typeof(Snake) &&
            neighbour.GetType() != typeof(Stag));
 }
Esempio n. 5
0
 public void adopt(AnimalSystem animal)
 {
     animal.disappear(animal.gameObject, adder);
     animal.on_adopt(this);
 }
Esempio n. 6
0
 public int get_index(AnimalSystem animal)
 {
     return(animals.IndexOf(animal));
 }
Esempio n. 7
0
 public bool already_adopted(AnimalSystem animal)
 {
     return(animals.Contains(animal));
 }
Esempio n. 8
0
 public void kill(AnimalSystem animal)
 {
     kill(animals.IndexOf(animal));
 }
Esempio n. 9
0
 public void abadondon(AnimalSystem animal)
 {
     animal.on_abandon(this);
     animals.Remove(animal);
 }
Esempio n. 10
0
 public override void use(AnimalSystem selection, int index)
 {
     selection.feed();
 }