예제 #1
0
 public void AddToQue(SoundType type)
 {
     if (_sounds.ContainsKey(type) && !ResoruceManger.SoundPlaying(_lastSoundPlayed))
     {
         SoundTypeToPlay = type;
     }
 }
예제 #2
0
        private void RenderName()
        {
            int textSize = _belief.Size / 2;

            Rectangle textBounds = Utils.GetTextBounds(ResoruceManger.GetFont(FONT_NAME, textSize), _belief.Name);

            RenderAdapter.DrawText
            (
                Colour.Black,
                new Point2D(Bounds.Center.X - textBounds.Width / 2, Bounds.Y - textBounds.Height),
                ResoruceManger.GetFont(FONT_NAME, textSize), _belief.Name
            );
        }
        public override void Render()
        {
            Rectangle boundsScreen = Utils.ToScreen(_bounds.HitBox);

            RenderAdapter.FillRectangle(Colour.White, boundsScreen);
            RenderAdapter.DrawRectangle(Colour.Black, boundsScreen);

            _subject.RenderPortrait(boundsScreen);

            RenderAdapter.DrawText
            (
                Colour.Black,
                new Point2D(boundsScreen.X, boundsScreen.Y2 - Convert.ToInt32(boundsScreen.Width / 6)),
                ResoruceManger.GetFont(Settings.DEFUALT_FONT_NAME, Convert.ToInt32(boundsScreen.Width / 6)),
                _subject.Title
            );
        }
예제 #4
0
        public GameManager(RenderAdapter renderAdapter, IUtilsAdapter utilsAdapter, IInputAdapter inputAdapter, IResourceAdapter resoruceAdapter)
        {
            _graphics = new GraphicsManager(renderAdapter);
            Utils.SetAdapter(utilsAdapter);
            _input = new InputManger(inputAdapter);
            ResoruceManger.SetAdapter(resoruceAdapter);

            SetUpGameWindow();
            LoadFonts();

            _world = new World(_factory, _settings.BackgroundMusicFileName);
            _ui    = new UserInterfaceManger(_factory, _world);
            Statistics.SetWorld(_world);
            // Must be called After adapters are set
            _collsion = new CollsionManger();
            _sound    = new SoundManger();
        }
예제 #5
0
        private void RenderAge()
        {
            int textSize = _belief.Size / 2;

            Rectangle textBounds = Utils.GetTextBounds
                                   (
                ResoruceManger.GetFont(FONT_NAME, textSize),
                _belief.Age.ToString()
                                   );

            RenderAdapter.DrawText
            (
                Colour.Black,
                new Point2D(Center.X - textBounds.Width / 2, Center.Y - textBounds.Height / 2),
                ResoruceManger.GetFont(FONT_NAME, textSize),
                _belief.Age.ToString()
            );
        }
예제 #6
0
 private void LoadFonts()
 {
     ResoruceManger.LoadFont(new Font(Settings.DEFUALT_FONT_NAME, Settings.Instance.NameFontFileName, 10));
 }