mirror of
https://github.com/dcronqvist/DotTiled.git
synced 2025-05-09 04:56:03 +03:00
Big properties work
This commit is contained in:
parent
1168917c23
commit
5e93716d2c
15 changed files with 820 additions and 55 deletions
|
@ -2,7 +2,7 @@ namespace DotTiled.Tests;
|
|||
|
||||
public partial class TestData
|
||||
{
|
||||
public static Map MapWithObjectTemplate() => new Map
|
||||
public static Map MapWithObjectTemplate(string templateExtension) => new Map
|
||||
{
|
||||
Version = "1.10",
|
||||
TiledVersion = "1.11.0",
|
||||
|
@ -49,7 +49,7 @@ public partial class TestData
|
|||
new RectangleObject
|
||||
{
|
||||
ID = 1,
|
||||
Template = "map-with-object-template.tx",
|
||||
Template = $"map-with-object-template.{templateExtension}",
|
||||
Name = "Thingy 2",
|
||||
X = 94.5749f,
|
||||
Y = 33.6842f,
|
||||
|
@ -73,7 +73,7 @@ public partial class TestData
|
|||
new RectangleObject
|
||||
{
|
||||
ID = 2,
|
||||
Template = "map-with-object-template.tx",
|
||||
Template = $"map-with-object-template.{templateExtension}",
|
||||
Name = "Thingy",
|
||||
X = 29.7976f,
|
||||
Y = 33.8693f,
|
||||
|
@ -97,7 +97,7 @@ public partial class TestData
|
|||
new RectangleObject
|
||||
{
|
||||
ID = 3,
|
||||
Template = "map-with-object-template.tx",
|
||||
Template = $"map-with-object-template.{templateExtension}",
|
||||
Name = "Thingy 3",
|
||||
X = 5,
|
||||
Y = 5,
|
||||
|
@ -112,7 +112,7 @@ public partial class TestData
|
|||
PropertyType = "TestClass",
|
||||
Properties = new Dictionary<string, IProperty>
|
||||
{
|
||||
["Amount"] = new FloatProperty { Name = "Amount", Value = 4.2f },
|
||||
["Amount"] = new FloatProperty { Name = "Amount", Value = 0.0f },
|
||||
["Name"] = new StringProperty { Name = "Name", Value = "I am here 3" }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
[
|
||||
{
|
||||
"color": "#ffa0a0a4",
|
||||
"drawFill": true,
|
||||
"id": 1,
|
||||
"members": [
|
||||
{
|
||||
"name": "Amount",
|
||||
"type": "float",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Name",
|
||||
"type": "string",
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"name": "TestClass",
|
||||
"type": "class",
|
||||
"useAs": [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
]
|
103
DotTiled.Tests/Serialization/TestData/propertytypes-2.json
Normal file
103
DotTiled.Tests/Serialization/TestData/propertytypes-2.json
Normal file
|
@ -0,0 +1,103 @@
|
|||
[
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Enum0String",
|
||||
"storageType": "string",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
"Enum0_1",
|
||||
"Enum0_2",
|
||||
"Enum0_3"
|
||||
],
|
||||
"valuesAsFlags": false
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Enum1Num",
|
||||
"storageType": "int",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
"Enum1Num_1",
|
||||
"Enum1Num_2",
|
||||
"Enum1Num_3",
|
||||
"Enum1Num_4"
|
||||
],
|
||||
"valuesAsFlags": false
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name": "Enum2StringFlags",
|
||||
"storageType": "string",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
"Enum2StringFlags_1",
|
||||
"Enum2StringFlags_2",
|
||||
"Enum2StringFlags_3",
|
||||
"Enum2StringFlags_4"
|
||||
],
|
||||
"valuesAsFlags": true
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"name": "Enum3NumFlags",
|
||||
"storageType": "int",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
"Enum3NumFlags_1",
|
||||
"Enum3NumFlags_2",
|
||||
"Enum3NumFlags_3",
|
||||
"Enum3NumFlags_4",
|
||||
"Enum3NumFlags_5"
|
||||
],
|
||||
"valuesAsFlags": true
|
||||
},
|
||||
{
|
||||
"color": "#ffa0a0a4",
|
||||
"drawFill": true,
|
||||
"id": 2,
|
||||
"members": [
|
||||
{
|
||||
"name": "Yep",
|
||||
"propertyType": "TestClass",
|
||||
"type": "class",
|
||||
"value": {
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "Test",
|
||||
"type": "class",
|
||||
"useAs": [
|
||||
"property",
|
||||
"map",
|
||||
"layer",
|
||||
"object",
|
||||
"tile",
|
||||
"tileset",
|
||||
"wangcolor",
|
||||
"wangset",
|
||||
"project"
|
||||
]
|
||||
},
|
||||
{
|
||||
"color": "#ffa0a0a4",
|
||||
"drawFill": true,
|
||||
"id": 1,
|
||||
"members": [
|
||||
{
|
||||
"name": "Amount",
|
||||
"type": "float",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Name",
|
||||
"type": "string",
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"name": "TestClass",
|
||||
"type": "class",
|
||||
"useAs": [
|
||||
"property"
|
||||
]
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue