public static InputTask SoftObjectFactory(SoftObjectType type, int amount) { return(new InputTask(InputMode.Single, (cells, selected) => { foreach (Cell cell in cells) { SoftObject softObject = new SoftObject(type, amount); cell.World.SpawnSoftObject(softObject, cell, softObject.Count); } }, null)); }
public PathfinderAStar PathForNearestSoftObject(SoftObjectType type, Cell startCell) { Cell endCell = NearestCell(startCell, (cell) => { return(cell.SoftObject != null && cell.SoftObject.Type == type); }); if (endCell == null) { return(null); } return(new PathfinderAStar(this, startCell, endCell)); }
public SoftObject(SoftObject clone, int amount) { type = clone.Type; Count = amount; }
// Constructor public SoftObject(SoftObjectType type, int amount = 0) { this.type = type; Count = amount; }