예제 #1
0
 public CaseManager FindCaseManager(IndexDataSource index)
 {
     CaseManager result = null;
     if (index != null && _boardItems != null && _boardItems.ContainsKey(index))
     {
         result = _boardItems[index].caseManager;
     }
     return result;
 }
예제 #2
0
 public bool Equals(IndexDataSource other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.row == this.row && other.column == this.column);
 }
예제 #3
0
 public bool IsBestColumnTurn(IndexDataSource indexDataSource)
 {
     var turn = boardManager.GetNextTurn(indexDataSource);
     return indexDataSource.column == turn.bestColumn;
 }
예제 #4
0
 public CaseManager GetCase(IndexDataSource index)
 {
     CaseManager result = null;
     if (index != null && boardManager != null)
     {
         result = boardManager.FindCaseManager(index);
     }
     return result;
 }
예제 #5
0
 public BendDataSource GetNextTurn(IndexDataSource indexDataSource)
 {
     BendDataSource result = null;
     var currentCase = this.FindCaseManager(indexDataSource);
     while (result == null)
     {
         if (currentCase.bendDataSource != null)
         {
             result = currentCase.bendDataSource;
         }
         else
         {
             var nextIndex = currentCase.itemDataSource.targets.FirstOrDefault(i => i.enable && i.column == indexDataSource.column);
             if (nextIndex == null)
             {
                 nextIndex = currentCase.itemDataSource.targets.FirstOrDefault();
             }
             currentCase = this.FindCaseManager(nextIndex);
         }
     }
     return result;
 }
예제 #6
0
 public bool Equals(IndexDataSource other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.row == this.row && other.column == this.column;
 }
예제 #7
0
 public PlayerContext FindPlayer(IndexDataSource index)
 {
     return ContextEngine.Instance.gameContext.players.FirstOrDefault(p => this.GetCurrentIndex(p).Equals(index));
 }