public void Update(StageSimulator stageSimulator) { var player = stageSimulator.Player; characterId = player.RowData.Id; level = player.Level; exp = player.Exp.Current; inventory = player.Inventory; worldInformation = player.worldInformation; foreach (var pair in player.monsterMap) { monsterMap.Add(pair); } foreach (var pair in player.eventMap) { eventMap.Add(pair); } if (stageSimulator.Log.IsClear) { stageMap.Add(new KeyValuePair <int, int>(stageSimulator.StageId, 1)); } foreach (var pair in stageSimulator.ItemMap) { itemMap.Add(pair); } UpdateStageQuest(stageSimulator.Rewards); }
public void Serialize() { var map = new CollectionMap(); map.Add(1, 1); map.Add(2, 1); var map2 = new CollectionMap(); map2.Add(2, 1); map2.Add(1, 1); var deserialized = new CollectionMap((Dictionary)map2.Serialize()); Assert.Equal(deserialized, map); }
public void GetEnumerator() { const int size = 10; var map = new CollectionMap(); for (var i = 0; i < size; i++) { map.Add(size - i, i); } var idx = 1; foreach (var(key, _) in map) { Assert.Equal(idx, key); idx++; } }
public async Task Query(int[][] pairs) { var collectionMap = new CollectionMap(); foreach (int[] pair in pairs) { collectionMap.Add( pair[0], pair[1]); } var result = await ExecuteQueryAsync <CollectionMapType>( "{ count pairs }", source : collectionMap); var resultData = (Dictionary <string, object>)result.Data; Assert.Equal(pairs.Length, resultData["count"]); Assert.Equal(pairs, resultData["pairs"]); }