Exemple #1
0
        public Actor(Point location, int health, IFov fov) :
            base(location)
        {
            MaxHealth = health;
            Health    = MaxHealth;
            Fov       = fov;

            Inventory = new List <GameObject>();
        }
Exemple #2
0
        private void DrawMap(IFov fov)
        {
            Cursor.Position = new SadRogue.Primitives.Point(0, 0);

            foreach (var cell in map.Cells())
            {
                var visibility = GetVisibility(cell, fov);
                this.Draw(cell, visibility, game.HasAmulet);
            }
        }
Exemple #3
0
        private void DrawGameObjects(IEnumerable <GameObject> gameObjects, IFov fov)
        {
            foreach (var gameObject in gameObjects)
            {
                var cell       = map.GetCellAt(gameObject.Location);
                var visibility = GetVisibility(cell, fov);

                this.Draw(gameObject, visibility);
            }
        }
Exemple #4
0
        private Visibility GetVisibility(ICell cell, IFov fov)
        {
            if (showEverything || fov.IsInFov(cell.Location.X, cell.Location.Y))
            {
                return(Visibility.InFov);
            }
            else if (map.IsDiscovered(cell.Location))
            {
                return(Visibility.Discovered);
            }

            return(Visibility.Hidden);
        }
Exemple #5
0
 public virtual void ReplaceFov(IFov newFov)
 {
     Fov = newFov;
 }
Exemple #6
0
 public Monster(MonsterType type, Point location, IFov fov) :
     base(location, GetStartingHealth(type), fov)
 {
     MonsterType = type;
 }