Example #1
0
        public EntityBase(Color foreground, Color background, int glyph, Map map, bool haveVision = false, int visionRange = 20) : base(1, 1)
        {
            Animation.CurrentFrame[0].Foreground = foreground;
            Animation.CurrentFrame[0].Background = background;
            Animation.CurrentFrame[0].Glyph      = glyph;

            EntityStatus = new EntityStatus();

            Inventory = new Inventory(EntityStatus.MaxWeight);

            this.map = map;

            HaveVision = haveVision;
            if (HaveVision)
            {
                fovmap      = new FOV(map);
                VisionRange = visionRange;
            }

            Equip = new ItemBase("Pickaxe", 10f);
            Equip.ItemBehaviour = ItemBehaviourHelper.Mine();

            random = RandomNumberServiceLocator.GetService();
            logger = LoggingServiceLocator.GetService();

            ID = random.NextUint();
        }
        public AdventureScreen()
        {
            DungeonScreen             = new DungeonScreen(0, 0, 100, 39, SadConsole.Global.Fonts["IBM"].GetFont(SadConsole.Font.FontSizes.One));
            StatusScreen              = new StatusConsole(110, 2, 40, 19);
            ScrollingConsole          = new ScrollingConsole(40, 15, 10000);
            ScrollingConsole.Position = new Point(110, 22);
            InventoryViewerWindow     = new InventoryViewerWindow()
            {
                Position = new Point(5, 5),
                Dragable = true
            };
            InventoryViewerWindow.Closed += InventoryViewerWindow_Closed;
            Prompt = new Prompt(12, 5, "Exit?", "Warning")
            {
                Position = new Point(70, 15)
            };
            Prompt.Closed += (o, e) =>
            {
                if (Prompt.DialogResult)
                {
                    Environment.Exit(0);
                }
            };
            Children.Add(DungeonScreen);
            Children.Add(StatusScreen);
            Children.Add(ScrollingConsole);
            Children.Add(InventoryViewerWindow);
            Children.Add(Prompt);

            Logger logger = new Logger(ScrollingConsole);

            LoggingServiceLocator.Provide(logger);
            this.logger = LoggingServiceLocator.GetService();

            this.random = RandomNumberServiceLocator.GetService();
        }
Example #3
0
 public Player(Map map) : base(Color.Yellow, Color.Black, '@', map, true)
 {
     logger   = LoggingServiceLocator.GetService();
     this.map = map;
 }