コード例 #1
0
ファイル: FileSystem.cs プロジェクト: lodossDev/xnamugen
		/// <summary>
		/// Initializes a new instance of this class.
		/// </summary>
		/// <param name="subsystems">Collection of subsystems to be used by this class.</param>
		public FileSystem(SubSystems subsystems)
			: base(subsystems)
		{
			m_textcache = new KeyedCollection<String, TextFile>(x => x.Filepath, StringComparer.OrdinalIgnoreCase);
			m_titleregex = new Regex(@"^\s*\[(.+?)\]\s*$", RegexOptions.IgnoreCase);
			m_parsedlineregex = new Regex(@"^\s*(.+?)\s*=\s*(.+?)\s*$", RegexOptions.IgnoreCase);
		}
コード例 #2
0
        /// <summary>
        /// 清除可能会冲突的实例(尽管禁用UIDate后再载入存档一般可以顺利进行,但游戏特殊情况仍会卡读档,在游戏开发稳定之前双保险)
        /// </summary>
        /// <returns></returns>
        private static bool Prefix(DateFile.LegendBook loadDate)
        {
            if (LoadFile.OnLoad)
            {
                LoadFile.OnLoad = false;
#if DEBUG
                var m_Container = ReflectionMethod.GetValue <SingletonObject, GameObject>(null, "m_Container");
                Main.Logger.Log($"DateFile_Loadloadlegend: Is m_Container null? {m_Container == null}");
                foreach (string key in m_SingletonMap.Keys)
                {
                    Main.Logger.Log($"DateFile_Loadloadlegend m_SingletonMap keys {key}");
                }
#endif
                // 清除需要清除的实例(仿自 SingletonObject.ClearInstances)
                foreach (var inst in instancesToRemove)
                {
                    if (SingletonMap.TryGetValue(inst, out object item) && !DontClearList.Contains(item))
                    {
                        (item as IDisposable)?.Dispose();
                        if (item is Component cmp)
                        {
                            UnityEngine.Object.Destroy(cmp);
                        }
                        SingletonMap.Remove(inst);
                    }
                }
                // 清除Subsystem中可能存在冲突的实例
                SubSystems.OnUnloadGameData();
            }
            return(true);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of this class.
 /// </summary>
 /// <param name="subsystems">Collection of subsystems to be used by this class.</param>
 public FileSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_textcache       = new KeyedCollection <String, TextFile>(x => x.Filepath, StringComparer.OrdinalIgnoreCase);
     m_titleregex      = new Regex(@"^\s*\[(.+?)\]\s*$", RegexOptions.IgnoreCase);
     m_parsedlineregex = new Regex(@"^\s*(.+?)\s*=\s*(.+?)\s*$", RegexOptions.IgnoreCase);
 }
コード例 #4
0
 public DiagnosticSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_form       = new DiagnosticForm();
     m_formthread = new Thread(StartFormThread);
     m_lock       = new Object();
 }
コード例 #5
0
 public DiagnosticSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_form = new DiagnosticForm();
     m_formthread = new Thread(StartFormThread);
     m_lock = new Object();
 }
コード例 #6
0
ファイル: FightEngine.cs プロジェクト: terrynoya/xnamugen-1
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            var textfile    = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def");
            var filesection = textfile.GetSection("Files");
            var basepath    = GetSubSystem <IO.FileSystem>().GetDirectory(textfile.Filepath);

            Entities         = new EntityCollection(this);
            Pause            = new Pause(this, false);
            SuperPause       = new Pause(this, true);
            Assertions       = new EngineAssertions();
            Camera           = new Camera(this);
            EnvironmentColor = new EnvironmentColor(this);
            EnvironmentShake = new EnvironmentShake(this);
            Speed            = GameSpeed.Normal;
            Fonts            = BuildFontMap(filesection);
            FightSounds      = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("snd")));
            CommonSounds     = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("common.snd")));
            FightSprites     = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("sff")));
            FxSprites        = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("fightfx.sff")));
            FightAnimations  = GetSubSystem <Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            FxAnimations     = GetSubSystem <Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("fightfx.air")));
            Elements         = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            RoundInformation = new RoundInformation(this, textfile);
            Team1            = new Team(this, TeamSide.Left);
            Team2            = new Team(this, TeamSide.Right);
            m_combatcheck    = new CombatChecker(this);
            m_logic          = new Logic.PreIntro(this);
            Clock            = new Clock(this);
        }
コード例 #7
0
        bool IBinaryConverter <ImageOptionalHeaderROM> .Convert(ref ImageOptionalHeaderROM s, uint startOffset, uint size)
        {
            LinkerVersion    = new Version(s.MajorLinkerVersion, s.MinorLinkerVersion);
            ImageVersion     = new Version(0, 0);
            SystemVersion    = ImageVersion;
            SubSystemVersion = ImageVersion;
            Win32Version     = ImageVersion;

            DataDirectoryCount = 0;
            EntryPointAddress  = s.AddressOfEntryPoint;
            Checksum           = 0;
            ImageBaseAddress   = s.BaseOfBss;
            SectionAlignment   = 0;
            RvaCount           = 0;
            CodeBaseAddress    = s.BaseOfCode;
            DataBaseAddress    = s.BaseOfData;

            CodeSize              = s.SizeOfCode;
            ImageSize             = 0;
            HeaderSize            = 0;
            HeapCommitSize        = 0;
            HeapReserveSize       = 0;
            StackCommitSize       = 0;
            StackReserveSize      = 0;
            InitializedDataSize   = s.SizeOfInitializedData;
            UninitializedDataSize = s.SizeOfUninitializedData;
            LoaderFlags           = LoaderFlags.Unknown;
            Characteristics       = AdvancedCharacteristics.Unknown;
            SubSystem             = SubSystems.WindowsCE_GUI;

            UpdateFileInfo(DefaultName, startOffset, size);
            UpdateVirtualInfo(FileOffset, FileSize);
            return(false);
        }
コード例 #8
0
        bool IBinaryConverter <ImageOptionalHeader64> .Convert(ref ImageOptionalHeader64 s, uint startOffset, uint size)
        {
            LinkerVersion    = new Version(s.MajorLinkerVersion, s.MinorLinkerVersion);
            ImageVersion     = new Version(s.MajorImageVersion, s.MinorImageVersion);
            SystemVersion    = new Version(s.MajorOperatingSystemVersion, s.MinorOperatingSystemVersion);
            SubSystemVersion = new Version(s.MajorSubsystemVersion, s.MinorSubsystemVersion);
            Win32Version     = new Version((int)s.Win32VersionValue, 0);

            DataDirectoryCount = DefaultDataDirectoryCount;
            EntryPointAddress  = s.AddressOfEntryPoint;
            Checksum           = s.CheckSum;
            ImageBaseAddress   = s.ImageBase;
            SectionAlignment   = s.SectionAlignment;
            RvaCount           = s.NumberOfRvaAndSizes;
            CodeBaseAddress    = s.BaseOfCode;
            DataBaseAddress    = 0;

            CodeSize              = s.SizeOfCode;
            ImageSize             = s.SizeOfImage;
            HeaderSize            = s.SizeOfHeaders;
            HeapCommitSize        = s.SizeOfHeapCommit;
            HeapReserveSize       = s.SizeOfHeapReserve;
            StackCommitSize       = s.SizeOfStackCommit;
            StackReserveSize      = s.SizeOfStackReserve;
            InitializedDataSize   = s.SizeOfInitializedData;
            UninitializedDataSize = s.SizeOfUninitializedData;
            LoaderFlags           = (LoaderFlags)s.LoaderFlags;
            Characteristics       = (AdvancedCharacteristics)s.DllCharacteristics;
            SubSystem             = (SubSystems)s.Subsystem;

            UpdateFileInfo(DefaultName, startOffset, size + DefaultDataDirectoryCount * (uint)Marshal.SizeOf(typeof(DataSectionDescription.ImageDataDirectory)));
            UpdateVirtualInfo(FileOffset, FileSize);
            return(false);
        }
コード例 #9
0
ファイル: Engine.cs プロジェクト: darkfriend77/wom
        public void Run()
        {
            IsRunning = true;

            var startupSystems = SubSystems.OrderBy(s => s.StartupOrder);
            Queue <ISubSystem> shutdownQueue = new Queue <ISubSystem>();

            foreach (var startupSystem in startupSystems)
            {
                startupSystem.Start();
                shutdownQueue.Enqueue(startupSystem);
            }

            var tickSystems = SubSystems.OrderBy(s => s.TickOrder).ToList();

            while (IsRunning)
            {
                foreach (var tickSystem in tickSystems)
                {
                    tickSystem.Tick();
                }
            }

            while (shutdownQueue.TryDequeue(out ISubSystem shutdownSystem))
            {
                shutdownSystem.Shutdown();
            }
        }
コード例 #10
0
ファイル: MenuSystem.cs プロジェクト: terrynoya/xnamugen-1
        public MenuSystem(SubSystems subsystems)
            : base(subsystems)
        {
            var textfile = GetSubSystem <FileSystem>().OpenTextFile(@"data/system.def");
            var info     = textfile.GetSection("info");
            var files    = textfile.GetSection("files");

            MotifName   = info.GetAttribute("name", string.Empty);
            MotifAuthor = info.GetAttribute("author", string.Empty);

            var fontmap = new Dictionary <int, Font>();

            var spritesystem = GetSubSystem <SpriteSystem>();

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

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

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

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

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

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

            FontMap = new FontMap(fontmap);

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

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

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

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

            CombatScreen     = new CombatScreen(this);
            ReplayScreen     = new RecordedCombatScreen(this);
            StoryboardScreen = new StoryboardScreen(this);

            CurrentScreen = null;
            m_newscreen   = null;
            m_fade        = 0;
            m_fadespeed   = 0;
            m_eventqueue  = new Queue <Events.Base>();
        }
コード例 #11
0
ファイル: StringFormatter.cs プロジェクト: lodossDev/xnamugen
 public StringFormatter(SubSystems systems)
     : base(systems)
 {
     m_lock = new Object();
     m_builder = new StringBuilder(100);
     m_args = new List<Object>();
 }
コード例 #12
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>();
        }
コード例 #13
0
ファイル: SpriteSystem.cs プロジェクト: terrynoya/xnamugen-1
 public SpriteSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_spritefiles      = new KeyedCollection <string, SpriteFile>(x => x.Filepath, StringComparer.OrdinalIgnoreCase);
     m_palettefilecache = new Dictionary <string, Texture2D>(StringComparer.OrdinalIgnoreCase);
     m_fontcache        = new KeyedCollection <string, Font>(x => x.Filepath, StringComparer.OrdinalIgnoreCase);
     m_fontlinemapregex = new Regex("(\\S+)\\s?(\\d+)?\\s?(\\d+)?", RegexOptions.IgnoreCase);
     m_loader           = new PcxLoader(this);
 }
コード例 #14
0
ファイル: StateSystem.cs プロジェクト: lodossDev/xnamugen
 public StateSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_statefiles = new Dictionary<String, ReadOnlyKeyedCollection<Int32, State>>(StringComparer.OrdinalIgnoreCase);
     m_controllertitleregex = new Regex(@"^State\s+(\S.*)$", RegexOptions.IgnoreCase);
     m_statertitleregex = new Regex("Statedef\\s*(-?\\d+).*", RegexOptions.IgnoreCase);
     m_controllermap = BuildControllerMap();
     m_internalstates = GetStates("xnaMugen.data.Internal.cns");
 }
コード例 #15
0
        /// <summary>
        /// 执行存档读取操作
        /// </summary>
        public static void DoLoad(int dataId)
        {
            Main.onLoad = true;
            UIDate.instance.gameObject.SetActive(false);
            // 释放资源
            SubSystems.OnUnloadGameData();

            MainMenu.instance.SetLoadIndex(dataId);
        }
コード例 #16
0
ファイル: SpriteSystem.cs プロジェクト: lodossDev/xnamugen
		public SpriteSystem(SubSystems subsystems)
			: base(subsystems)
		{
			m_spritefiles = new KeyedCollection<String, SpriteFile>(x => x.Filepath, StringComparer.OrdinalIgnoreCase);
			m_palettefilecache = new Dictionary<String, Texture2D>(StringComparer.OrdinalIgnoreCase);
			m_fontcache = new KeyedCollection<String, Font>(x => x.Filepath, StringComparer.OrdinalIgnoreCase);
			m_fontlinemapregex = new Regex("(\\S+)\\s?(\\d+)?\\s?(\\d+)?", RegexOptions.IgnoreCase);
			m_loader = new PcxLoader(this);
		}
コード例 #17
0
        public CommandSystem(SubSystems subsystems)
            : base(subsystems)
        {
            m_commandcache     = new Dictionary <string, ReadOnlyList <Command> >(StringComparer.OrdinalIgnoreCase);
            m_numberregex      = new Regex("(\\d+)", RegexOptions.IgnoreCase);
            m_internalcommands = GetCommands("xnaMugen.data.Internal.cmd");

            //Test();
        }
コード例 #18
0
ファイル: SoundSystem.cs プロジェクト: terrynoya/xnamugen-1
        /// <summary>
        /// Initializes a new instance of this class.
        /// </summary>
        /// <param name="subsystems">Collection of subsystems.</param>
        public SoundSystem(SubSystems subsystems)
            : base(subsystems)
        {
            m_soundcache = new Dictionary <string, ReadOnlyDictionary <SoundId, byte[]> >(StringComparer.OrdinalIgnoreCase);
            m_volume     = 0;
            m_channels   = new List <Channel>();

            CreateSoundChannels(10);
        }
コード例 #19
0
ファイル: InputSystem.cs プロジェクト: lodossDev/xnamugen
 /// <summary>
 /// Initializes a new instance of this class.
 /// </summary>
 /// <param name="subsystems">The collection of subsystems.</param>
 public InputSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_keymap = new Dictionary<Keys, ButtonWrapper>();
     m_previousstate = new KeyboardState();
     m_inputstatestack = new Stack<InputState>();
     m_currentinput = new InputState();
     m_callbackcache = new List<Action<Boolean>>();
 }
コード例 #20
0
        private SubSystemDTO ToSubSystemDTO(SubSystems item)
        {
            SubSystemDTO result = new SubSystemDTO();

            result.ID          = item.ID;
            result.Name        = item.Name;
            result.Description = item.Description;
            return(result);
        }
コード例 #21
0
ファイル: CommandSystem.cs プロジェクト: lodossDev/xnamugen
		public CommandSystem(SubSystems subsystems)
			: base(subsystems)
		{
			m_commandcache = new Dictionary<String, ReadOnlyList<Command>>(StringComparer.OrdinalIgnoreCase);
			m_numberregex = new Regex("(\\d+)", RegexOptions.IgnoreCase);
			m_internalcommands = GetCommands("xnaMugen.data.Internal.cmd");

			//Test();
		}
コード例 #22
0
 /// <summary>
 /// Initializes a new instance of this class.
 /// </summary>
 /// <param name="subsystems">The collection of subsystems.</param>
 public InputSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_keymap          = new Dictionary <Keys, ButtonWrapper>();
     m_previousstate   = new KeyboardState();
     m_inputstatestack = new Stack <InputState>();
     m_currentinput    = new InputState();
     m_callbackcache   = new List <Action <bool> >();
 }
コード例 #23
0
ファイル: StateSystem.cs プロジェクト: terrynoya/xnamugen-1
 public StateSystem(SubSystems subsystems)
     : base(subsystems)
 {
     _statefiles           = new Dictionary <string, ReadOnlyKeyedCollection <int, State> >(StringComparer.OrdinalIgnoreCase);
     _controllertitleregex = new Regex(@"^State\s+(\S.*)$", RegexOptions.IgnoreCase);
     _staterTitleRegex     = new Regex("Statedef\\s*(-?\\d+).*", RegexOptions.IgnoreCase);
     _controllermap        = BuildControllerMap();
     _internalstates       = GetStates("xnaMugen.data.Internal.cns");
 }
コード例 #24
0
 public DiagnosticSystem(SubSystems subsystems)
     : base(subsystems)
 {
     if (Environment.OSVersion.IsWindows())
     {
         m_form       = new DiagnosticForm();
         m_formthread = new Thread(StartFormThread);
     }
     m_lock = new object();
 }
コード例 #25
0
ファイル: SoundSystem.cs プロジェクト: lodossDev/xnamugen
		/// <summary>
		/// Initializes a new instance of this class.
		/// </summary>
		/// <param name="subsystems">Collection of subsystems.</param>
		public SoundSystem(SubSystems subsystems)
			: base(subsystems)
		{
			m_soundcache = new Dictionary<String, ReadOnlyDictionary<SoundId, SecondaryBuffer>>(StringComparer.OrdinalIgnoreCase);
			m_sounddevice = new Device();
			m_volume = 0;
			m_channels = new List<Channel>();

			CreateSoundChannels(10);
		}
コード例 #26
0
		public EvaluationSystem(SubSystems subsystems)
			: base(subsystems)
		{
			m_expressioncache = new KeyedCollection<String, Expression>(x => x.ToString(), StringComparer.OrdinalIgnoreCase);
			m_tokenizer = new Tokenizer();
			m_treebuilder = new TreeBuilder(this);
			m_compiler = new Compiler();

			//var exp = CreateExpression("0.0 = [-10, 10]");
			//var result = exp.Evaluate(null);
		}
コード例 #27
0
        public EvaluationSystem(SubSystems subsystems)
            : base(subsystems)
        {
            m_expressioncache = new KeyedCollection <String, Expression>(x => x.ToString(), StringComparer.OrdinalIgnoreCase);
            m_tokenizer       = new Tokenizer();
            m_treebuilder     = new TreeBuilder(this);
            m_compiler        = new Compiler();

            //var exp = CreateExpression("0.0 = [-10, 10]");
            //var result = exp.Evaluate(null);
        }
コード例 #28
0
    IEnumerator GameLoop()
    {
        SubSystems.Init( );
        while (true)
        {
            yield return(null);

            break;
        }
        SubSystems.DeInit( );
    }
コード例 #29
0
        /// <summary>
        /// 执行存档读取操作
        /// </summary>
        public static void DoLoad(int dataId)
        {
            OnLoad = true;
            // 防止UI活动生成新的SingletonObject实例
            UIDate.instance.gameObject.SetActive(false);
            // 来自DateFile.BackToStartMenu()方法,载入存档前清空,防止载入存档时载入奇书数据时卡档
            SingletonObject.ClearInstances();
            // 释放资源
            SubSystems.OnUnloadGameData();

            MainMenu.instance.SetLoadIndex(dataId);
        }
コード例 #30
0
        public VideoSystem(SubSystems subsystems)
            : base(subsystems)
        {
            m_devicemanager = (GraphicsDeviceManager)SubSystems.Game.Services.GetService(typeof(IGraphicsDeviceService));
            m_screensize    = new Point(m_devicemanager.PreferredBackBufferWidth, m_devicemanager.PreferredBackBufferHeight);
            m_camerashift   = new Point(0, 0);
            m_tint          = Color.White;
            m_renderer      = new Renderer(this);
            m_stringbuilder = new StringBuilder();

            Device.DeviceReset += OnDeviceReset;

            OnDeviceReset(this, EventArgs.Empty);
        }
コード例 #31
0
ファイル: SerialNumber.cs プロジェクト: rowetechinc/RTI
        /// <summary>
        /// Return a string representing only the subsystems
        /// listed in the SubSystem list.  This will drop all the
        /// 0's from the list.
        /// </summary>
        /// <returns>String of the subsystems.</returns>
        public string SubsystemsString()
        {
            string result = "";

            for (int x = 0; x < SubSystems.Length; x++)
            {
                if (SubSystems.Substring(x, 1) != "0")
                {
                    result += SubSystems.Substring(x, 1);
                }
            }

            return(result);
        }
コード例 #32
0
ファイル: VideoSystem.cs プロジェクト: lodossDev/xnamugen
        public VideoSystem(SubSystems subsystems)
            : base(subsystems)
        {
            m_devicemanager = (GraphicsDeviceManager)SubSystems.Game.Services.GetService(typeof(IGraphicsDeviceService));
            m_screensize = new Point(m_devicemanager.PreferredBackBufferWidth, m_devicemanager.PreferredBackBufferHeight);
            m_camerashift = new Point(0, 0);
            m_tint = Color.White;
            m_renderer = new Renderer(this);
            m_stringbuilder = new StringBuilder();

            Device.DeviceReset += OnDeviceReset;

            OnDeviceReset(this, EventArgs.Empty);
        }
コード例 #33
0
ファイル: SerialNumber.cs プロジェクト: rowetechinc/RTI
        /// <summary>
        /// Generate the serial number string based off the serial number
        /// values.
        /// </summary>
        /// <returns>String of the serial number.</returns>
        private string GetSerialNumberString()
        {
            StringBuilder result = new StringBuilder();

            // Base Electronics
            if (string.IsNullOrEmpty(BaseHardware))
            {
                result.Append("00");
            }
            else
            {
                result.Append(BaseHardware.PadLeft(BASE_HDWR_NUM_BYTES, '0'));
            }

            // Subsystems
            if (string.IsNullOrEmpty(SubSystems))
            {
                result.Append("000000000000000");
            }
            else
            {
                // Set the subsystems, padding the end with 0's
                result.Append(SubSystems.PadRight(SUBSYSTEM_NUM_BYTES, '0'));
            }

            // Spare
            if (string.IsNullOrEmpty(Spare))
            {
                result.Append("000000000");
            }
            else
            {
                result.Append(Spare.PadRight(SPARE_NUM_BYTES, '0'));
            }

            // Serial number
            if (SystemSerialNumber == EMPTY_SERIAL_NUM)
            {
                result.Append("000000");
            }
            else
            {
                string serial = SystemSerialNumber.ToString();
                result.Append(serial.PadLeft(SERIAL_NUM_BYTES, '0'));
            }


            return(result.ToString());
        }
コード例 #34
0
ファイル: Patch.cs プロジェクト: hanabi1224/ScrollOfTaiwuMods
 /// <summary>
 /// 执行存档读取操作
 /// </summary>
 public static void DoLoad(int dataId)
 {
     OnLoad = true;
     // 先 ChangeGameState , 擠掉之前的 GameState
     // 避免在 DateFile.instance.Initialize 時觸發 前一個 State 的 OnExit
     // 會造成一些問題 (例如讀檔後戰鬥黑屏)
     Game.Instance.ChangeGameState(eGameState.Login, new object[] { eMainMenuShow.None });
     // 用 GMPanel 的寫法
     SubSystems.OnLeaveGame();
     GameData.Common.OnLeaveGame();
     WorldMapSystem.instance.ResetWorldMap();
     UIManager.Instance.DestroyAllOldPrefabs();
     SingletonObject.ClearInstances();
     DateFile.instance.Initialize(dataId, false);
 }
コード例 #35
0
 public virtual void Sort(bool recursive = true)
 {
     if (!isSorted)
     {
         SubSystems.Sort((a, b) => a.rank - b.rank);
     }
     isSorted = true;
     if (recursive)
     {
         for (int i = 0, len = SubSystems.Count; i < len; i++)
         {
             SubSystems[i].Sort(recursive);
         }
     }
 }
コード例 #36
0
ファイル: VideoSystem.cs プロジェクト: terrynoya/xnamugen-1
        public VideoSystem(SubSystems subsystems)
            : base(subsystems)
        {
            m_devicemanager = (GraphicsDeviceManager)SubSystems.Game.Services.GetService(typeof(IGraphicsDeviceService));
            m_screensize    = new Point(m_devicemanager.PreferredBackBufferWidth, m_devicemanager.PreferredBackBufferHeight);
            m_camerashift   = new     Point(0, 0);
            m_tint          = Color.White;
            m_renderer      = new Renderer(this);
            m_stringbuilder = new StringBuilder();
            EmptyTexture    = new Texture2D(Device, 2, 2);
            EmptyTexture.SetData(Enumerable.Range(0, 4).Select(i => Color.White).ToArray());

            Device.DeviceReset += OnDeviceReset;

            OnDeviceReset(this, EventArgs.Empty);
        }
コード例 #37
0
ファイル: MenuSystem.cs プロジェクト: lodossDev/xnamugen
        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>();
        }
コード例 #38
0
 public InitializationSettings(SubSystems subsystems)
     : base(subsystems)
 {
     m_screensize = Mugen.ScreenSize;
     m_useoldshader = false;
     m_vsync = true;
     m_diagonsticwindow = false;
     m_keeplog = false;
     m_preloadsprites = true;
     m_screenshotformat = ScreenShotFormat.Png;
     m_systemkeys = new Dictionary<SystemButton, Keys>();
     m_p1keys = new Dictionary<PlayerButton, Keys>();
     m_p2keys = new Dictionary<PlayerButton, Keys>();
     m_roundlength = 99;
     m_soundchannels = 10;
     m_recordreplay = false;
     m_quitafterreplay = true;
 }
コード例 #39
0
ファイル: MugenTest.cs プロジェクト: lodossDev/xnamugen
        protected override void Initialize()
        {
            m_subsystems = new SubSystems(this);
            m_subsystems.GetSubSystem<IO.FileSystem>().Initialize();
            m_subsystems.GetSubSystem<InitializationSettings>().Initialize();
            m_subsystems.GetSubSystem<Input.InputSystem>().Initialize();
            m_subsystems.GetSubSystem<Video.VideoSystem>().Initialize();

            //m_font = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().LoadFont(@"font/num1.fnt");
            //m_sprites = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(@"chars/BuraiYamamoto/Burai.sff");
            //m_animations = m_subsystems.GetSubSystem<Animations.AnimationSystem>().CreateManager(@"chars/BuraiYamamoto/Burai.air");

            m_sprites = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(@"chars/kfm/kfm.sff");
            m_animations = m_subsystems.GetSubSystem<Animations.AnimationSystem>().CreateManager(@"chars/kfm/kfm.air");

            m_animations.SetLocalAnimation(0, 0);
            m_sprites.LoadSprites(m_animations.CurrentAnimation);

            m_subsystems.GetSubSystem<Input.InputSystem>().CurrentInput[0].Add(SystemButton.DebugDraw, this.Click);

            base.Initialize();
        }
コード例 #40
0
ファイル: FightEngine.cs プロジェクト: lodossDev/xnamugen
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            IO.TextFile textfile = GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection filesection = textfile.GetSection("Files");
            String basepath = GetSubSystem<IO.FileSystem>().GetDirectory(textfile.Filepath);

			m_init = null;
            m_entities = new EntityCollection(this);
            m_roundnumber = 0;
            m_stage = null;
            m_idcounter = 0;
            m_tickcount = 0;
            m_pause = new Pause(this, false);
            m_superpause = new Pause(this, true);
            m_asserts = new EngineAssertions();
            m_camera = new Camera(this);
            m_envcolor = new EnvironmentColor(this);
            m_envshake = new EnvironmentShake(this);
            m_speed = GameSpeed.Normal;
            m_slowspeedbuffer = 0;
            m_fontmap = BuildFontMap(filesection);
            m_fightsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("snd")));
            m_commonsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("common.snd")));
            m_fightsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("sff")));
            m_fxsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.sff")));
            m_fightanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            m_fxanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.air")));
            m_elements = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            m_roundinfo = new RoundInformation(this, textfile);
            m_team1 = new Team(this, TeamSide.Left);
            m_team2 = new Team(this, TeamSide.Right);
            m_combatcheck = new CombatChecker(this);
            m_logic = new Logic.PreIntro(this);
			m_clock = new Clock(this);
        }
コード例 #41
0
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            IO.TextFile    textfile    = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection filesection = textfile.GetSection("Files");
            String         basepath    = GetSubSystem <IO.FileSystem>().GetDirectory(textfile.Filepath);

            m_init            = null;
            m_entities        = new EntityCollection(this);
            m_roundnumber     = 0;
            m_stage           = null;
            m_idcounter       = 0;
            m_tickcount       = 0;
            m_pause           = new Pause(this, false);
            m_superpause      = new Pause(this, true);
            m_asserts         = new EngineAssertions();
            m_camera          = new Camera(this);
            m_envcolor        = new EnvironmentColor(this);
            m_envshake        = new EnvironmentShake(this);
            m_speed           = GameSpeed.Normal;
            m_slowspeedbuffer = 0;
            m_fontmap         = BuildFontMap(filesection);
            m_fightsounds     = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("snd")));
            m_commonsounds    = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("common.snd")));
            m_fightsprites    = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("sff")));
            m_fxsprites       = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("fightfx.sff")));
            m_fightanimations = GetSubSystem <Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            m_fxanimations    = GetSubSystem <Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("fightfx.air")));
            m_elements        = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            m_roundinfo       = new RoundInformation(this, textfile);
            m_team1           = new Team(this, TeamSide.Left);
            m_team2           = new Team(this, TeamSide.Right);
            m_combatcheck     = new CombatChecker(this);
            m_logic           = new Logic.PreIntro(this);
            m_clock           = new Clock(this);
        }
コード例 #42
0
 /// <summary>
 /// Initializes a new instance of this class.
 /// </summary>
 /// <param name="subsystems">A collection of subsystems to be referenced.</param>
 public AnimationSystem(SubSystems subsystems)
     : base(subsystems)
 {
     m_animationcache = new Dictionary <String, KeyedCollection <Int32, Animation> >(StringComparer.OrdinalIgnoreCase);
     m_loader         = new AnimationLoader(this);
 }
コード例 #43
0
ファイル: Random.cs プロジェクト: lodossDev/xnamugen
 /// <summary>
 /// Initializes a new instance of this class with a time dependant seed.
 /// </summary>
 public Random(SubSystems subsystems)
     : base(subsystems)
 {
     Seed(Environment.TickCount);
 }
コード例 #44
0
ファイル: Mugen.cs プロジェクト: lodossDev/xnamugen
        /// <summary>
        /// Initializes engine subsystems, including drawing, sound and input.
        /// </summary>
        protected override void Initialize()
        {
            m_subsystems = new SubSystems(this);
            m_subsystems.LoadAllSubSystems();

            m_subsystems.GetSubSystem<IO.FileSystem>().Initialize();
            m_subsystems.GetSubSystem<InitializationSettings>().Initialize();
            m_subsystems.GetSubSystem<ProfileLoader>().Initialize();
            m_subsystems.GetSubSystem<Input.InputSystem>().Initialize();
            m_subsystems.GetSubSystem<Video.VideoSystem>().Initialize();
            m_subsystems.GetSubSystem<Audio.SoundSystem>().Initialize();
            m_subsystems.GetSubSystem<Diagnostics.DiagnosticSystem>().Initialize();

            m_subsystems.LoadAllMainSystems();

            m_subsystems.GetSubSystem<Input.InputSystem>().CurrentInput[0].Add(SystemButton.DebugDraw, this.ToggleDebugDraw);
            m_subsystems.GetSubSystem<Input.InputSystem>().CurrentInput[0].Add(SystemButton.TakeScreenshot, this.TakeScreenshot);

            base.Initialize();
        }
コード例 #45
0
ファイル: Engine.cs プロジェクト: darkfriend77/wom
 public T GetSubSystem <T>() where T : ISubSystem
 {
     return(SubSystems.OfType <T>().FirstOrDefault());
 }
コード例 #46
0
ファイル: Profiles.cs プロジェクト: lodossDev/xnamugen
 public ProfileLoader(SubSystems subsystems)
     : base(subsystems)
 {
     m_stages = new List<StageProfile>();
     m_players = new List<PlayerSelect>();
 }
コード例 #47
0
ファイル: AnimationSystem.cs プロジェクト: lodossDev/xnamugen
		/// <summary>
		/// Initializes a new instance of this class.
		/// </summary>
		/// <param name="subsystems">A collection of subsystems to be referenced.</param>
		public AnimationSystem(SubSystems subsystems)
			: base(subsystems)
		{
			m_animationcache = new Dictionary<String, KeyedCollection<Int32, Animation>>(StringComparer.OrdinalIgnoreCase);
			m_loader = new AnimationLoader(this);
		}
コード例 #48
0
ファイル: Engine.cs プロジェクト: darkfriend77/wom
 public void RegisterSubsystem(ISubSystem subSystem)
 {
     SubSystems.Add(subSystem);
 }