public Map(string name, Coord playerInitialPosition, BidimensionalArray <Atom> table, TernaryValue notToExplore, bool dark) { this.name = name; this.playerInitialPosition = playerInitialPosition; this.table = table; this.table.ForEach(a => a.SetMap(this)); this.buffer = new BidimensionalArray <Atom>(table.Rows, table.Cols, (pos) => { var f = new Floor(pos); f.SetMap(this); return(f); }); this.untangibles = new BidimensionalArray <AtomCollection>(table.Rows, table.Cols, () => new AtomCollection()); this.explored = new BidimensionalArray <TernaryValue>(table.Rows, table.Cols, notToExplore); this.dark = new BidimensionalArray <bool>(table.Rows, table.Cols, dark); this.views = new List <IMapViewer>(); table.ForEach(atom => atom.InsertInMap(this, atom.Position, true)); }
public static bool ToBool(this TernaryValue v) { return(v == TernaryValue.Explored); }