add POCO's for json deserialization of tile mesh collections
This includes some extras for tile meshes using arbitrary models which haven't been implemented yet (as a subclass of TileMesh)
This commit is contained in:
parent
6ba60825ce
commit
4d6fd90943
|
@ -213,6 +213,10 @@
|
||||||
<Compile Include="TileMap\Lighting\LightSpreadingTileMapLighter.cs" />
|
<Compile Include="TileMap\Lighting\LightSpreadingTileMapLighter.cs" />
|
||||||
<Compile Include="TileMap\Prefabs\TilePrefab.cs" />
|
<Compile Include="TileMap\Prefabs\TilePrefab.cs" />
|
||||||
<Compile Include="TileMap\Rotation.cs" />
|
<Compile Include="TileMap\Rotation.cs" />
|
||||||
|
<Compile Include="TileMap\Meshes\Json\JsonCubeTextures.cs" />
|
||||||
|
<Compile Include="TileMap\Meshes\Json\JsonTileDefinition.cs" />
|
||||||
|
<Compile Include="TileMap\Meshes\Json\JsonTileMeshCollection.cs" />
|
||||||
|
<Compile Include="TileMap\Meshes\Json\JsonTileSubModel.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -241,6 +245,7 @@
|
||||||
<Folder Include="TileMap\Meshes\" />
|
<Folder Include="TileMap\Meshes\" />
|
||||||
<Folder Include="TileMap\Lighting\" />
|
<Folder Include="TileMap\Lighting\" />
|
||||||
<Folder Include="TileMap\Prefabs\" />
|
<Folder Include="TileMap\Prefabs\" />
|
||||||
|
<Folder Include="TileMap\Meshes\Json\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Resources\Fonts\Vera.ttf" />
|
<EmbeddedResource Include="Resources\Fonts\Vera.ttf" />
|
||||||
|
|
15
Blarg.GameFramework/TileMap/Meshes/Json/JsonCubeTextures.cs
Normal file
15
Blarg.GameFramework/TileMap/Meshes/Json/JsonCubeTextures.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Blarg.GameFramework.TileMap.Meshes.Json
|
||||||
|
{
|
||||||
|
public class JsonCubeTextures
|
||||||
|
{
|
||||||
|
public int Top;
|
||||||
|
public int Bottom;
|
||||||
|
public int Front;
|
||||||
|
public int Back;
|
||||||
|
public int Left;
|
||||||
|
public int Right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Blarg.GameFramework.Graphics;
|
||||||
|
|
||||||
|
namespace Blarg.GameFramework.TileMap.Meshes.Json
|
||||||
|
{
|
||||||
|
public class JsonTileDefinition
|
||||||
|
{
|
||||||
|
public bool Cube;
|
||||||
|
public JsonCubeTextures Textures;
|
||||||
|
public int Texture;
|
||||||
|
public List<string> Faces;
|
||||||
|
public string Model;
|
||||||
|
public List<JsonTileSubModel> JsonTileSubModels;
|
||||||
|
public string CollisionModel;
|
||||||
|
public string CollisionShape;
|
||||||
|
public List<string> OpaqueSides;
|
||||||
|
public int Light;
|
||||||
|
public bool Alpha;
|
||||||
|
public float Translucency;
|
||||||
|
public Color Color;
|
||||||
|
public Vector3 ScaleToSize;
|
||||||
|
public Vector3 PositionOffset;
|
||||||
|
public Vector3 CollisionPositionOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Blarg.GameFramework.TileMap.Meshes.Json
|
||||||
|
{
|
||||||
|
public class JsonTileMeshCollection
|
||||||
|
{
|
||||||
|
public List<JsonTileDefinition> Tiles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
14
Blarg.GameFramework/TileMap/Meshes/Json/JsonTileSubModel.cs
Normal file
14
Blarg.GameFramework/TileMap/Meshes/Json/JsonTileSubModel.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using Blarg.GameFramework.Graphics;
|
||||||
|
|
||||||
|
namespace Blarg.GameFramework.TileMap.Meshes.Json
|
||||||
|
{
|
||||||
|
public class JsonTileSubModel
|
||||||
|
{
|
||||||
|
public string Submodel;
|
||||||
|
public Color Color;
|
||||||
|
public Vector3 ScaleToSize;
|
||||||
|
public Vector3 PositionOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Reference in a new issue