public void Place(CPos cell, Entity entity, StructureGrid grid) { var cellid = cell.CellId; for (int i = 0; i < grid.Length; i++) { layer[cellid + grid[i]] = new GridCell(entity); } }
/// <summary> /// Here we Update the MetroGrid View /// </summary> /// <param name="option">Give me Options of Update you need jsut like Sucsess or Failed</param> /// <param name="view">Which Grid view you need sucess or error , this is Controll at Main form</param> private void UpdateGrid(UpdateGridOptions option, StructureGrid view) { switch (option) { case UpdateGridOptions.Sucsess: sucessSource.Add((SucsessGrid)view); break; case UpdateGridOptions.Failed: errorSource.Add((FiledGrid)view); break; } }
public bool CanPlace(CPos cell, StructureGrid grid) { var cellid = cell.CellId; for (int i = 0; i < grid.Length; i++) { if (!layer[cellid + grid[i]].IsPassable) { return(false); } } return(true); }