Skip to content

Instantly share code, notes, and snippets.

@adarapata
Created June 5, 2013 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adarapata/5715085 to your computer and use it in GitHub Desktop.
Save adarapata/5715085 to your computer and use it in GitHub Desktop.
カーソル
/// <summary>
/// コンテンツを選択するカーソルインタフェース
/// </summary>
public interface ICursol
{
/// <summary>
/// 現在選択中のコンテンツ
/// </summary>
ICursolContent content { set; get; }
/// <summary>
/// 他のコンテンツを選択する
/// </summary>
/// <param name="direction"></param>
void Select(CursolDirection direction);
/// <summary>
/// 現在選択しているコンテンツの決定処理を行う
/// </summary>
void Decision();
}
/// <summary>
/// カーソルで選択できるコンテンツのインタフェース
/// </summary>
public interface ICursolContent{
/// <summary>
/// このコンテンツ選択した時のアクション
/// </summary>
void SelectedAction();
/// <summary>
/// このコンテンツを離れた時のアクション
/// </summary>
ICursolContent LeavedAction(CursolDirection direction);
/// <summary>
/// このコンテンツを選択したときのアクション
/// </summary>
void DecisionAction();
}
/// <summary>
/// カーソルの動く方向
/// </summary>
public enum CursolDirection
{
UP,
Down,
Right,
Left
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment