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:
Gered 2013-08-28 22:48:00 -04:00
parent 6ba60825ce
commit 4d6fd90943
5 changed files with 72 additions and 0 deletions

View file

@ -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" />

View 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;
}
}

View file

@ -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;
}
}

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace Blarg.GameFramework.TileMap.Meshes.Json
{
public class JsonTileMeshCollection
{
public List<JsonTileDefinition> Tiles;
}
}

View 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;
}
}