public MasuInit GetMasu(int x, int y) { if (x > 9 || y > 9 || x < 1 || y < 1) { MasuInit masu = new MasuInit(); masu.Init(0, 0); return(masu); } return(komas [x + "-" + y]); }
// マスを空に public void EmptyMasu(int x, int y) { if (x > 9 || y > 9 || x < 1 || y < 1) { return; } MasuInit masu = new MasuInit(); masu.Init(x, y); komas [x + "-" + y] = masu; }
public void Init() { for (int x = 1; x <= 9; x++) { for (int y = 1; y <= 9; y++) { MasuInit masu = new MasuInit(); masu.Init(x, y); komas [x + "-" + y] = masu; } } }