public void SetCellProperties(int column, int row, InGameEditor.Properties editorProperties) { int index = GetCellIndex(column, row); HexCell cell = cells[index]; CellType.Type cellType = editorProperties.GetCellType(); cell.SetType(cellType); }
public void SetType(CellType.Type cellType) { if ((type == null) || (type.Get() != cellType)) { type = new CellType(cellType); if (painter != null) { painter.Init(type); } } }
public CellType.Type GetCellType() { CellType.Type type = CellType.Type.None; switch (groundType) { case GroundType.Sand: type = CellType.Type.Sand; break; case GroundType.Grass: type = CellType.Type.Grass; break; case GroundType.Dirt: type = CellType.Type.Dirt; break; } if (stone) { type = type | CellType.Type.Stone; } return(type); }
public void SetCellType(CellType.Type cellType) { if ((cellType & CellType.Type.Sand) != 0) { groundType = GroundType.Sand; } else if ((cellType & CellType.Type.Grass) != 0) { groundType = GroundType.Grass; } else if ((cellType & CellType.Type.Dirt) != 0) { groundType = GroundType.Dirt; } else { Debug.Assert(false, "Invalid ground type"); groundType = GroundType.Invalid; } stone = (cellType & CellType.Type.Stone) != 0; }
public void RemoveType(CellType.Type cellType) { CellType.Type newtype = type.Get() & ~cellType; SetType(newtype); }
public void AddType(CellType.Type cellType) { CellType.Type newtype = type.Get() | cellType; SetType(newtype); }