示例#1
0
        public OpenUOSDK(string path = "")
        {
            if (_ClientData == null && (path != "" || path != null))
            {
                if (Directory.Exists(path))
                {
                    _ClientData = path;
                }
            }

            IoCContainer container = new IoCContainer();

            container.RegisterModule <UltimaSDKCoreModule>();
            container.RegisterModule <UltimaSDKBitmapModule>();

            InstallLocation location = (_ClientData == null ? InstallationLocator.Locate().FirstOrDefault() : (InstallLocation)_ClientData);

            if (!Directory.Exists(location.ToString()))
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("OpenUO Error: Client files not found.");
                Utility.PopColor();
            }

            _animationDataFactory = new AnimationDataFactory(location, container);
            _animationFactory     = new AnimationFactory(location, container);
            _artworkFactory       = new ArtworkFactory(location, container);
            _asciiFontFactory     = new ASCIIFontFactory(location, container);
            _clilocFactory        = new ClilocFactory(location, container);
            _gumpFactory          = new GumpFactory(location, container);
            _skillsFactory        = new SkillsFactory(location, container);
            _soundFactory         = new SoundFactory(location, container);
            _texmapFactory        = new TexmapFactory(location, container);
            _unicodeFontFactory   = new UnicodeFontFactory(location, container);
        }
示例#2
0
        public OpenUOSDK(string path = "")
        {
            if (ClientDataPath == null && !String.IsNullOrWhiteSpace(path))
            {
                if (Directory.Exists(path))
                {
                    ClientDataPath = path;
                }
            }

            var container = new Container();

            container.RegisterModule <UltimaSDKCoreModule>();
            container.RegisterModule <UltimaSDKBitmapModule>();

            InstallLocation location = (ClientDataPath == null
                                                                                        ? InstallationLocator.Locate().FirstOrDefault()
                                                                                        : (InstallLocation)ClientDataPath);

            if (location == null || String.IsNullOrWhiteSpace(location) || !Directory.Exists(location.ToString()))
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("OpenUO Error: Client files not found.");
                Utility.PopColor();
            }

            AnimationDataFactory = new AnimationDataFactory(location, container);
            AnimationFactory     = new AnimationFactory(location, container);
            ArtFactory           = new ArtworkFactory(location, container);
            AsciiFontFactory     = new ASCIIFontFactory(location, container);
            ClilocFactory        = new ClilocFactory(location, container);
            GumpFactory          = new GumpFactory(location, container);
            SkillsFactory        = new SkillsFactory(location, container);
            SoundFactory         = new SoundFactory(location, container);
            TexmapFactory        = new TexmapFactory(location, container);
            UnicodeFontFactory   = new UnicodeFontFactory(location, container);
        }