using System; /// /// This interface defines a subject that can select an item. This is the IItemContainer counterpart of the observer /// pattern. It is used so that either items can directly observe, and know whether to be active or not, or /// a shop view can tell the items what to do, active or not. /// public interface IItemSelector { // Require some way to register observers so that they can be notified when selection changes void RegisterOnSelect(IItemContainer observer); void RemoveOnSelect(IItemContainer observer); void OnSelect(Item selected); // Actual selection methods, so we have a selection to begin with void SelectItem(Item selected); void SelectItemByIndex(int index); }