public void Load()
{
try
{
this._grid.Children.Clear();
_lightList.Clear();
_darkList.Clear();
_cells.Clear();
InitializeCells();
FileStream fs = new FileStream("save.bin", FileMode.Open);
BinaryReader r = new BinaryReader(fs);
int i, j, lcount;
MyPoint t;
IsLightTurn = r.ReadBoolean();
lcount = r.ReadInt32();
for (int ii = 0; ii < lcount; ii++)
{
i = r.ReadInt32(); j = r.ReadInt32();
t = new MyPoint(_cells[i][j], MyPoint.LIGHT, i, j);
this._grid.Children.Add(t.CurrentImage);
_lightList.Add(t);
}
while (r.BaseStream.Position < r.BaseStream.Length)
{
i = r.ReadInt32(); j = r.ReadInt32();
t = new MyPoint(_cells[i][j], MyPoint.DARK, i, j);
this._grid.Children.Add(t.CurrentImage);
_darkList.Add(t);
}
fs.Close();
}
catch (Exception)
{
throw;
}
}