private void AddDef(TileType tileType, int count = 1) { for (int i = 1; i <= count; i++) { var def = new TileParams() { Type = tileType }; _list.Add(def); } }
private void AddArrowDef(int arrowsCode, int count) { for (int i = 1; i <= count; i++) { var def = new TileParams() { Type = TileType.Arrow, ArrowsCode = arrowsCode }; _list.Add(def); } }
private void AddSpinningDef(int spirnningCount, int count) { for (int i = 1; i <= count; i++) { var def = new TileParams() { Type = TileType.Spinning, SpinningCount = spirnningCount }; _list.Add(def); } }
public Tile(TileParams tileParams) { Position = tileParams.Position; Type = tileParams.Type; int levelsCount = (tileParams.Type == TileType.Spinning) ? tileParams.SpinningCount : 1; for (int level = 0; level < levelsCount; level++) { var tileLevel = new TileLevel(new TilePosition(tileParams.Position, level)); Levels.Add(tileLevel); } ArrowsCode = tileParams.ArrowsCode; SpinningCount = tileParams.SpinningCount; CannonDirection = tileParams.CanonDirection; }