示例#1
0
文件: Actor.cs 项目: jeansberg/Rogue
        public Actor(Point location, int health, IFov fov) :
            base(location)
        {
            MaxHealth = health;
            Health    = MaxHealth;
            Fov       = fov;

            Inventory = new List <GameObject>();
        }
示例#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);
            }
        }
示例#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);
            }
        }
示例#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);
        }
示例#5
0
文件: Actor.cs 项目: jeansberg/Rogue
 public virtual void ReplaceFov(IFov newFov)
 {
     Fov = newFov;
 }
示例#6
0
 public Monster(MonsterType type, Point location, IFov fov) :
     base(location, GetStartingHealth(type), fov)
 {
     MonsterType = type;
 }