public void TestLoadandSearchdescriptorData() { descriptorData = GameDataStorageLayerTestUtils.fillOtherDataObjectsWithData(GameDataStorageLayerUtils.objectClassType.Descriptor); string keyToSearch = "testChar:descriptorData"; Tuple <string, Tuple <string, string> > t = descriptorData[keyToSearch].searchForKey("testChar:descriptorData:Demon"); Assert.AreEqual("testChar:descriptorData:Demon", t.Item1); Assert.AreEqual("Demonic Being", t.Item2.Item2); Assert.AreEqual("testChar/descriptorData/Demon", t.Item2.Item1); }
public void TestLoadandSearchextraData() { extraData = GameDataStorageLayerTestUtils.fillOtherDataObjectsWithData(GameDataStorageLayerUtils.objectClassType.Extra); string keyToSearch = "testChar:extraData"; Tuple <string, Tuple <string, string> > t = extraData[keyToSearch].searchForKey("testChar:extraData:Always Fail"); Assert.AreEqual("testChar:extraData:Always Fail", t.Item1); Assert.AreEqual("Always fail a critical hit.", t.Item2.Item2); Assert.AreEqual("testChar/extraData/Always Fail", t.Item2.Item1); }
public void TestLoadandSearchAttributeData() { attributeData = GameDataStorageLayerTestUtils.fillAttributeObjectWithData(); string keyToSearch = "testChar:attributes"; Tuple <string, Tuple <string, int> > t = attributeData[keyToSearch].searchForKey("testChar:attributes:Strength"); Assert.AreEqual("testChar:attributes:Strength", t.Item1); Assert.AreEqual(10, t.Item2.Item2); Assert.AreEqual("testChar/attributes/Strength", t.Item2.Item1); }
public void TestLoadandSearchmodifiedData() { modifiedData = GameDataStorageLayerTestUtils.fillOtherDataObjectsWithData(GameDataStorageLayerUtils.objectClassType.Modified); string keyToSearch = "testChar:modifiedData"; Tuple <string, Tuple <string, string> > t = modifiedData[keyToSearch].searchForKey("testChar:modifiedData:Extra Strength"); Assert.AreEqual("testChar:modifiedData:Extra Strength", t.Item1); Assert.AreEqual("This creature has extra stength of 8.", t.Item2.Item2); Assert.AreEqual("testChar/modifiedData/Extra Strength", t.Item2.Item1); }
public void tryInstantiateGameObject() { byte[] d = GameDataStorageLayerTestUtils.getSampleCharacterFromXML(); GameDataStorageObject gds = new GameDataStorageObject(d); ConcurrentDictionary <string, BaseObject> cd = (ConcurrentDictionary <string, BaseObject>)gds.getDataFromStorageObject(GameDataStorageLayerUtils.objectClassType.Attribute); foreach (KeyValuePair <string, BaseObject> kv in cd) { string type = kv.Value.getClassType(); if (type == GameDataStorageLayerUtils.objectClassType.Attribute.ToString()) { BaseGameDataStorageObject <string, Tuple <string, int> > bgso = (BaseGameDataStorageObject <string, Tuple <string, int> >)kv.Value; Tuple <string, Tuple <string, int> > x = bgso.getValueAt(0); Console.WriteLine("Hello world"); } else if (type == GameDataStorageLayerUtils.objectClassType.Descriptor.ToString()) { BaseGameDataStorageObject <string, Tuple <string, string> > bgso = (BaseGameDataStorageObject <string, Tuple <string, string> >)kv.Value; Tuple <string, Tuple <string, string> > x = bgso.getValueAt(0); Console.WriteLine("Hello world"); } } }