Exemplo n.º 1
0
 public bool Equals(CellDefinition <T> other)
 {
     if (other is null)
     {
         return(false);
     }
     return(Underlying.Equals(other.Underlying));
 }
Exemplo n.º 2
0
            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);
            }
Exemplo n.º 3
0
            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 };
            }
Exemplo n.º 4
0
 public Tile(VectorInt2 position, CellDefinition <T> value)
 {
     Position = position;
     Cell     = value;
 }
Exemplo n.º 5
0
 private Puzzle(IReadOnlyCartesianMap <CellDefinition <char> > map, CellDefinition <char> .Set definition) : base(map, definition)
 {
 }