Exemple #1
0
        // The actor opens the door located at the x,y position
        private void OpenDoor(Actor actor, int x, int y)
        {
            Doors door = GetDoor(x, y);

            if (door != null && !door.IsOpen)
            {
                door.IsOpen = true;
                var cell = GetCell(x, y);
                // Once the door is opened it should be marked as transparent and no longer block field-of-view
                SetCellProperties(x, y, true, cell.IsWalkable, cell.IsExplored);

                Game.MessageLog.Add($"{actor.Name} opened a door");
            }
        }
Exemple #2
0
 // Return the door at the x,y position or null if one is not found.
 public Doors GetDoor(int x, int y)
 {
     return(Doors.SingleOrDefault(d => d.X == x && d.Y == y));
 }