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); }
public void on_leaving(AnimalSystem animal) { if (animals.already_adopted(animal)) { return; } animals_around_player.Remove(animal); refresh_close_animals(); }
public virtual void use(AnimalSystem selection, int index) { Debug.Log("Using..."); }
private bool can_eat(AnimalSystem neighbour) { return(neighbour.GetType() != typeof(Wolf) && neighbour.GetType() != typeof(Snake) && neighbour.GetType() != typeof(Stag)); }
public void adopt(AnimalSystem animal) { animal.disappear(animal.gameObject, adder); animal.on_adopt(this); }
public int get_index(AnimalSystem animal) { return(animals.IndexOf(animal)); }
public bool already_adopted(AnimalSystem animal) { return(animals.Contains(animal)); }
public void kill(AnimalSystem animal) { kill(animals.IndexOf(animal)); }
public void abadondon(AnimalSystem animal) { animal.on_abandon(this); animals.Remove(animal); }
public override void use(AnimalSystem selection, int index) { selection.feed(); }