private bool MatchInDiagonal(MakerType maker) { for (int i = 0; i < 3; i++) { int counter = 0; if (Board.Cells[i, i].MakerType == maker) { counter++; } if (counter == 3) { return(true); } } for (int i = 0; i < 3; i++) { int counter = 0; if (Board.Cells[2 - i, i].MakerType == maker) { counter++; } if (counter == 3) { return(true); } } return(false); }
private bool HasMatch(MakerType marker) { if (MatchInRows(marker) || MatchInColumns(marker) || MatchInDiagonal(marker)) { return(true); } return(false); }
public void SetMarker(int x, int y, MakerType makerType) { if (!CanSetMarker(x, y)) { throw new Exception("Marker aleready set to this Cell"); } if (makerType == MakerType.None) { throw new Exception("Can not set MakerType.None"); } Cells[x, y].MakerType = makerType; }
private bool MatchInColumns(MakerType maker) { for (int j = 0; j < 3; j++) { int counter = 0; for (int i = 0; i < 3; i++) { if (Board.Cells[i, j].MakerType == maker) { counter++; } if (counter == 3) { return(true); } } } return(false); }
void SetPopUpTexture(MakerType type, MakerSize size) { //表示するテキストが存在しない if (size == MakerSize.None) { return; } if (size == MakerSize.LL) { size = MakerSize.L; } //Lに変換 if (type == MakerType.None) { type = MakerType.Y; } int index = ((int)type * (int)MakerType.None) + (int)size; transform.GetChild(0).GetComponent <Image>().sprite = MapManager.I.balloonImageList[index]; }
/// <summary> /// /// </summary> /// <param name="v"></param> /// <returns></returns> public static string ToString(MakerType v) { return(Enum.GetName(typeof(MakerType), v).ToLowerInvariant()); }
public Game(Board board, MakerType currentMarker) { this.Status = new GameStatus(); this.CurrentMarker = currentMarker; Board = board; }