Skip to content

Commit

Permalink
Map would store grid of Tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
iconstudio committed Oct 6, 2023
1 parent 99f1872 commit 04ca5bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Editor/TestEditor/Contents/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ internal struct Map : IMapEntity<SerializedMap>
{
internal Tileset myTileset;
internal Rectangle myResolution;
internal Tile[] myTiles;
public static Map EmptyMap { get; }

public Tileset Tileset
Expand Down Expand Up @@ -39,7 +40,7 @@ public int Height
{
readonly get => myResolution.Height; set => myResolution.Height = value;
}
public TileImage
public readonly Tile[] Tiles => myTiles;
public int HorizontalTiles { readonly get; set; }
public int VerticalTiles { readonly get; set; }
public readonly bool IsDeserializable => false;
Expand All @@ -64,6 +65,8 @@ public Map(in string name, in Tileset tileset)
{
myResolution = new();
myTileset = tileset;
myTiles = null;

Name = name;
Description = "";
HorizontalTiles = 0;
Expand All @@ -89,9 +92,12 @@ public readonly SerializedMap Serialize()
Tileset = Tileset.Serialize(),
Name = Name,
Description = Description,
X = X, Y = Y,
W = Width, H = Height,
HorizontalTiles = HorizontalTiles, VerticalTiles = VerticalTiles
X = X,
Y = Y,
W = Width,
H = Height,
HorizontalTiles = HorizontalTiles,
VerticalTiles = VerticalTiles
};
}
}
Expand Down

0 comments on commit 04ca5bf

Please sign in to comment.