public CaseManager FindCaseManager(IndexDataSource index) { CaseManager result = null; if (index != null && _boardItems != null && _boardItems.ContainsKey(index)) { result = _boardItems[index].caseManager; } return result; }
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); }
public bool IsBestColumnTurn(IndexDataSource indexDataSource) { var turn = boardManager.GetNextTurn(indexDataSource); return indexDataSource.column == turn.bestColumn; }
public CaseManager GetCase(IndexDataSource index) { CaseManager result = null; if (index != null && boardManager != null) { result = boardManager.FindCaseManager(index); } return result; }
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; }
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; }
public PlayerContext FindPlayer(IndexDataSource index) { return ContextEngine.Instance.gameContext.players.FirstOrDefault(p => this.GetCurrentIndex(p).Equals(index)); }