Skip to content

Commit

Permalink
Tile has id, x, y and ctors
Browse files Browse the repository at this point in the history
  • Loading branch information
iconstudio committed Oct 6, 2023
1 parent adb0adf commit de6ad0b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Editor/TestEditor/Contents/Tile.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
namespace TestEditor.Contents
using System.Diagnostics.Contracts;
using System.Text.Json.Serialization;

namespace TestEditor.Contents
{
[Serializable]
internal struct Tile
{
public int id;
public int x;
public int y;
[JsonInclude] public int id;
[JsonInclude] public int x;
[JsonInclude] public int y;

public Tile() : this(0, 0, 0)
{ }
[JsonConstructor]
public Tile(int tid, int tx, int ty)
{
id = tid;
x = tx;
y = ty;
}

[Pure]
public static Tile Create(int tid, int tx, int ty)
{
return new Tile()
Expand Down

0 comments on commit de6ad0b

Please sign in to comment.