public bool Equals(CellDefinition <T> other) { if (other is null) { return(false); } return(Underlying.Equals(other.Underlying)); }
public bool TryFromUnderlying(T c, out CellDefinition <T> cell) { foreach (var cc in this) { if (cc.Underlying.Equals(c)) { cell = cc; return(true); } ; } cell = null; return(false); }
public Set(T @void, T wall, T floor, T goal, T crate, T crateGoal, T player, T playerGoal) { Void = new CellDefinition <T>(@void, this); Wall = new CellDefinition <T>(wall, this); Floor = new CellDefinition <T>(floor, this); Goal = new CellDefinition <T>(goal, this); Crate = new CellDefinition <T>(crate, this); CrateGoal = new CellDefinition <T>(crateGoal, this); Player = new CellDefinition <T>(player, this); PlayerGoal = new CellDefinition <T>(playerGoal, this); AllFloors = new[] { Floor, Goal, Crate, Player, CrateGoal, PlayerGoal }; AllCrates = new[] { Crate, CrateGoal }; AllGoals = new[] { Goal, CrateGoal, PlayerGoal }; Obsticles = new[] { Void, Wall, Crate, CrateGoal, }; All = new[] { Void, Wall, Floor, Goal, Crate, Player, CrateGoal, PlayerGoal }; }
public Tile(VectorInt2 position, CellDefinition <T> value) { Position = position; Cell = value; }
private Puzzle(IReadOnlyCartesianMap <CellDefinition <char> > map, CellDefinition <char> .Set definition) : base(map, definition) { }