Namespace: DeltaEngine.Content.Json
Assembly: DeltaEngine.Content.Json (in DeltaEngine.Content.Json.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Content.Json.Tests.JsonNodeTests
2 unit tests call DeltaEngine.Content.Json.JsonNode.GetIntArray
Assembly: DeltaEngine.Content.Json (in DeltaEngine.Content.Json.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Return Value
Type: Int32Remarks
Examples
[Test] public void ReadArrayData() { var json = new JsonNode("{ \"arrayData\":[1, 2, 3] }"); Assert.AreEqual(1, json.NumberOfNodes); Assert.AreEqual(new[] { 1, 2, 3 }, json["arrayData"].GetIntArray()); }
[Test] public void ReadJsonArray() { var json = new JsonNode("{ \"layers\":[ { \"sky\":[1, 1] }, { \"ground\":[0, 0] } ] }"); Assert.AreEqual(1, json.NumberOfNodes); var layers = json["layers"]; Assert.AreEqual(2, layers.NumberOfNodes); Assert.AreEqual(new[] { 1, 1 }, layers[0]["sky"].GetIntArray()); Assert.AreEqual(new[] { 0, 0 }, layers[1]["ground"].GetIntArray()); }
See Also