Exemple #1
0
        private Drawing.FontMap BuildFontMap(IO.TextSection filesection)
        {
            if (filesection == null)
            {
                throw new ArgumentNullException(nameof(filesection));
            }

            var fonts = new Dictionary <int, Drawing.Font>();

            var fontpath1 = filesection.GetAttribute <string>("font1", null);

            if (fontpath1 != null)
            {
                fonts[1] = GetSubSystem <Drawing.SpriteSystem>().LoadFont(fontpath1);
            }

            var fontpath2 = filesection.GetAttribute <string>("font2", null);

            if (fontpath2 != null)
            {
                fonts[2] = GetSubSystem <Drawing.SpriteSystem>().LoadFont(fontpath2);
            }

            var fontpath3 = filesection.GetAttribute <string>("font3", null);

            if (fontpath3 != null)
            {
                fonts[3] = GetSubSystem <Drawing.SpriteSystem>().LoadFont(fontpath3);
            }

            var fontmap = new Drawing.FontMap(fonts);

            return(fontmap);
        }
Exemple #2
0
        public Collection(Drawing.SpriteManager sprites, Animations.AnimationManager animations, Audio.SoundManager sounds, Drawing.FontMap fontmap)
        {
            if (sprites == null)
            {
                throw new ArgumentNullException("sprites");
            }
            if (animations == null)
            {
                throw new ArgumentNullException("animations");
            }
            if (sounds == null)
            {
                throw new ArgumentNullException("sounds");
            }
            if (fontmap == null)
            {
                throw new ArgumentNullException("fontmap");
            }

            m_elements         = new KeyedCollection <String, Elements.Base>(x => x.Name, StringComparer.OrdinalIgnoreCase);
            m_spritemanager    = sprites;
            m_animationmanager = animations;
            m_soundmanager     = sounds;
            m_fontmap          = fontmap;
        }
Exemple #3
0
        public Collection(Drawing.SpriteManager sprites, Animations.AnimationManager animations, Audio.SoundManager sounds, Drawing.FontMap fontmap)
        {
            if (sprites == null)
            {
                throw new ArgumentNullException(nameof(sprites));
            }
            if (animations == null)
            {
                throw new ArgumentNullException(nameof(animations));
            }
            if (sounds == null)
            {
                throw new ArgumentNullException(nameof(sounds));
            }
            if (fontmap == null)
            {
                throw new ArgumentNullException(nameof(fontmap));
            }

            m_elements         = new Dictionary <string, Base>(StringComparer.OrdinalIgnoreCase);
            m_spritemanager    = sprites;
            m_animationmanager = animations;
            m_soundmanager     = sounds;
            m_fontmap          = fontmap;
        }
Exemple #4
0
        public MenuSystem(SubSystems subsystems)
            : base(subsystems)
        {
            TextFile    textfile = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/system.def");
            TextSection info     = textfile.GetSection("info");
            TextSection files    = textfile.GetSection("files");

            m_motifname   = info.GetAttribute <String>("name", String.Empty);
            m_motifauthor = info.GetAttribute <String>("author", String.Empty);

            Dictionary <Int32, Font> fontmap = new Dictionary <Int32, Font>();

            Drawing.SpriteSystem spritesystem = GetSubSystem <Drawing.SpriteSystem>();

            String fontpath1 = files.GetAttribute <String>("font1", null);

            if (fontpath1 != null)
            {
                fontmap[1] = spritesystem.LoadFont(fontpath1);
            }

            String fontpath2 = files.GetAttribute <String>("font2", null);

            if (fontpath2 != null)
            {
                fontmap[2] = spritesystem.LoadFont(fontpath2);
            }

            String fontpath3 = files.GetAttribute <String>("font3", null);

            if (fontpath3 != null)
            {
                fontmap[3] = spritesystem.LoadFont(fontpath3);
            }

            m_fontmap = new Drawing.FontMap(fontmap);

            String soundpath  = @"data/" + files.GetAttribute <String>("snd");
            String spritepath = @"data/" + files.GetAttribute <String>("spr");
            String animpath   = textfile.Filepath;

            m_titlescreen = new TitleScreen(this, textfile.GetSection("Title Info"), spritepath, animpath, soundpath);
            m_titlescreen.LoadBackgrounds("Title", textfile);

            m_versusscreen = new VersusScreen(this, textfile.GetSection("VS Screen"), spritepath, animpath, soundpath);
            m_versusscreen.LoadBackgrounds("Versus", textfile);

            m_selectscreen = new SelectScreen(this, textfile.GetSection("Select Info"), spritepath, animpath, soundpath);
            m_selectscreen.LoadBackgrounds("Select", textfile);

            m_combatscreen = new CombatScreen(this);
            m_replayscreen = new RecordedCombatScreen(this);

            m_currentscreen = null;
            m_newscreen     = null;
            m_fade          = 0;
            m_fadespeed     = 0;
            m_eventqueue    = new Queue <Events.Base>();
        }
Exemple #5
0
        public MenuSystem(SubSystems subsystems)
            : base(subsystems)
        {
            TextFile textfile = GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/system.def");
            TextSection info = textfile.GetSection("info");
            TextSection files = textfile.GetSection("files");

            m_motifname = info.GetAttribute<String>("name", String.Empty);
            m_motifauthor = info.GetAttribute<String>("author", String.Empty);

            Dictionary<Int32, Font> fontmap = new Dictionary<Int32, Font>();

            Drawing.SpriteSystem spritesystem = GetSubSystem<Drawing.SpriteSystem>();

            String fontpath1 = files.GetAttribute<String>("font1", null);
            if (fontpath1 != null) fontmap[1] = spritesystem.LoadFont(fontpath1);

            String fontpath2 = files.GetAttribute<String>("font2", null);
            if (fontpath2 != null) fontmap[2] = spritesystem.LoadFont(fontpath2);

            String fontpath3 = files.GetAttribute<String>("font3", null);
            if (fontpath3 != null) fontmap[3] = spritesystem.LoadFont(fontpath3);

            m_fontmap = new Drawing.FontMap(fontmap);

            String soundpath = @"data/" + files.GetAttribute<String>("snd");
            String spritepath = @"data/" + files.GetAttribute<String>("spr");
            String animpath = textfile.Filepath;

            m_titlescreen = new TitleScreen(this, textfile.GetSection("Title Info"), spritepath, animpath, soundpath);
            m_titlescreen.LoadBackgrounds("Title", textfile);

            m_versusscreen = new VersusScreen(this, textfile.GetSection("VS Screen"), spritepath, animpath, soundpath);
            m_versusscreen.LoadBackgrounds("Versus", textfile);

            m_selectscreen = new SelectScreen(this, textfile.GetSection("Select Info"), spritepath, animpath, soundpath);
            m_selectscreen.LoadBackgrounds("Select", textfile);

            m_combatscreen = new CombatScreen(this);
            m_replayscreen = new RecordedCombatScreen(this);

            m_currentscreen = null;
            m_newscreen = null;
            m_fade = 0;
            m_fadespeed = 0;
            m_eventqueue = new Queue<Events.Base>();
        }
Exemple #6
0
        Drawing.FontMap BuildFontMap(IO.TextSection filesection)
        {
            if (filesection == null) throw new ArgumentNullException("filesection");

            Dictionary<Int32, Drawing.Font> fonts = new Dictionary<Int32, Drawing.Font>();

            String fontpath1 = filesection.GetAttribute<String>("font1", null);
            if (fontpath1 != null) fonts[1] = GetSubSystem<Drawing.SpriteSystem>().LoadFont(fontpath1);

            String fontpath2 = filesection.GetAttribute<String>("font2", null);
            if (fontpath2 != null) fonts[2] = GetSubSystem<Drawing.SpriteSystem>().LoadFont(fontpath2);

            String fontpath3 = filesection.GetAttribute<String>("font3", null);
            if (fontpath3 != null) fonts[3] = GetSubSystem<Drawing.SpriteSystem>().LoadFont(fontpath3);

            Drawing.FontMap fontmap = new Drawing.FontMap(fonts);
            return fontmap;
        }