-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBlockCollection.cs
57 lines (55 loc) · 2.34 KB
/
BlockCollection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Block2Json
{
public class BlockCollection
{
public List<Block> blocks = new List<Block>();
public string Comments = "?";
public class Block
{
#region Coordinate
private Vector3 Coordinate = new Vector3();
public void SetCoordinate(int X, int Y, int Z) { Coordinate.X = X; Coordinate.Y = Y; Coordinate.Z = Z; }
public Vector3 GetCoordinate() { return Coordinate; }
#endregion
#region BlockInfo
private BlockInfo BlockInfo { get; set; }
public void SetInfo(BlockInfo blockInfo) { BlockInfo = blockInfo; }
public BlockInfo GetBlockInfo() { return BlockInfo; }
#endregion
public List<JsonModel.SimpleElement> GetSimpleElements(string directoryPath, BlockCollection blockCollection, ResourceList res = null)
{
var infoElements = GetElement(blockCollection, res);
var elements = new List<JsonModel.SimpleElement>();
foreach(var e in infoElements)
{
var g = e.GetElement(BlockInfo, GetCoordinate(), directoryPath);
elements.Add(e.GetElement(BlockInfo, GetCoordinate(), directoryPath));
}
return elements;
}
public List<ModelInfo._Enum.Element> GetElement(BlockCollection blockCollection, ResourceList res = null)
{ return BlockInfo.GetModelInfo().GetElements(BlockInfo, blockCollection, GetCoordinate(), res); }
}
public Block[,,] level;
public Block GetBlock(int X, int Y, int Z)
{
return level[X,Y,Z];
}
#region Size
private int Width { get; set; }
public void SetWidth(int width) { Width = width; }
public int GetWidth() { return Width; }
private int Height { get; set; }
public void SetHeight(int height) { Height = height; }
public int GetHeight() { return Height; }
private int Length { get; set; }
public void SetLength(int length) { Length = length; }
public int GetLength() { return Length; }
#endregion
}
}