You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
753 B
18 lines
753 B
using System;
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
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);
|
|
}
|
|
|