public void LoadSavedMap_IsNotNull() { const string filePath = "BoardActionMapTests_LoadSave.test.json"; var stateValues = new StateValueTable(BoardTile.X); PolicyFileIo.Save(stateValues, "name", "description", filePath); var loadedStateValues = PolicyFileIo.LoadStateValueTable(filePath); Assert.IsNotNull(loadedStateValues); }
public static void Save( StateValueTable stateValues, string name, string description, string path) { var table = new SerializableStateValueTable(name, description, stateValues.Tile); table.SetStateValues(stateValues); File.WriteAllText(path, JsonSerializer.Serialize(table, BuildJsonOptions())); }
public void SaveAndLoad() { const string name = "name"; const string description = "description"; const string filename = "PolicyFileIoTests.SaveAndLoad.json"; var stateValues = new StateValueTable(BoardTile.X); PolicyFileIo.Save(stateValues, name, description, filename); var policy = PolicyFileIo.FromFile("PolicyFileIoTests.SaveAndLoad.json"); Assert.AreEqual(name, policy.Name); Assert.AreEqual(description, policy.Description); }
public GreedyStateValuePlayer(StateValueTable stateValues, BoardTile tile) { _stateValues = stateValues; Tile = tile; }