Exemplo n.º 1
0
        static void Main()
        {
            // 设置应用程序
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 初始化系统
            string location       = RSystem.Location();
            string configFileName = location + @"\..\Configuration\environment.mobile.xml";

            RMoCommon.Initialize();
            RMoCommon.LoadEnvironment(configFileName);
            // 加载配置信息
            string applicationRoot = RMoCommon.GetEnvironment("application.root");

            LoadDirectory(applicationRoot);


            //QMapDesignForm form = new QMapDesignForm();
            //FMbMap map = RMobileManager.MapConsole.FindById(101);
            //form.LoadMap(map);
            //Application.Run(form);

            QMapConsoleForm.Instance.Open();
            Application.Run(QMapConsoleForm.Instance);
            // 释放系统
            RMoCore.Release();
        }
Exemplo n.º 2
0
        static void Main()
        {
            //Bitmap bmp = new Bitmap("D:\\test.png");
            //Bitmap nbmp = new Bitmap(bmp, 256, 256);
            //for (int y = 0; y < 256; y++) {
            //   for (int x = 0; x < 256; x++) {
            //      Color color = bmp.GetPixel(x, y);
            //      int alpha = (0xFF - color.R) * 2;
            //      nbmp.SetPixel(x, y, Color.FromArgb(Math.Min(alpha, 0xFF), 0xFF, 0xFF, 0xFF));
            //   }
            //}
            //nbmp.Save("D:\\test2.png");

            // 设置应用程序
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 初始化系统
            RMoCommon.Initialize();
            RMoCore.Initialize();
            // 加载环境文件
            string environmentFileName = RSystem.Location(@"\..\Configuration\environment.mobile.xml");

            RMoCommon.LoadEnvironment(environmentFileName);
            //............................................................
            // 加载配置文件
            string configFileName = RMoCommon.ParseEnvironment(@"${application.root}\Configuration\configuration.xml");

            using (FXmlDocument xdoc = new FXmlDocument(configFileName)) {
                FXmlNode xconfig = xdoc.Root;
                RMoCore.LoadConfig(xconfig);
                RContent2dManager.LoadConfig(xconfig);
                RDesign2dManager.LoadConfig(xconfig);
            }
            //............................................................
            // 配置处理
            RMoCore.Setup();
            RContent2dManager.Setup();
            RDesign2dManager.Setup();
            //............................................................
            // 显示资源表单
            QTrackForm.Instance.Open();
            QTaskForm.Instance.Open();
            // 显示工作界面
            //QUiConsoleForm.Instance.Open();
            //QUiConsoleForm.Instance.Text += " - [" + configFileName + "]";
            //Application.Run(QUiConsoleForm.Instance);
            // 显示工作界面
            //QUiDesignForm form = RDesign2dManager.FrameConsole.OpenDesignForm("runtime.window");
            //Application.Run(form);
            QUiConsoleForm.Instance.Open();
            QUiConsoleForm.Instance.Text += " - [" + configFileName + "] v131115";
            Application.Run(QUiConsoleForm.Instance);
            //// 释放系统
            //RDesign2dManager.Release();
            //RContent2dManager.Release();
            RMoCore.Release();
            RMoCommon.Release();
        }
Exemplo n.º 3
0
        static void Main()
        {
            // 设置应用程序
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 初始化系统
            RMoCommon.Initialize();
            RMoCore.Initialize();
            // 加载环境文件
            string environmentFileName = RSystem.Location(@"\..\Configuration\environment.mobile.xml");

            RMoCommon.LoadEnvironment(environmentFileName);
            //............................................................
            // 加载配置文件
            string configFileName = RMoCommon.ParseEnvironment(@"${application.root}\Configuration\configuration.xml");

            using (FXmlDocument xdoc = new FXmlDocument(configFileName)) {
                FXmlNode xconfig = xdoc.Root;
                RMoCore.LoadConfig(xconfig);
                RContent2dManager.LoadConfig(xconfig);
                RDesign2dManager.LoadConfig(xconfig);
            }
            //............................................................
            // 配置处理
            RMoCore.Setup();
            RContent2dManager.Setup();
            RDesign2dManager.Setup();
            //............................................................
            // 显示资源表单
            QTrackForm.Instance.Open();
            QTaskForm.Instance.Open();
            // 显示工作界面
            QDsDesignForm.Instance.Open();
            QDsDesignForm.Instance.Text += " - [" + configFileName + "]";
            Application.Run(QDsDesignForm.Instance);
            // 显示工作界面
            //QUiConsoleForm.Instance.Open();
            //QUiConsoleForm.Instance.Text += " - [" + configFileName + "]";
            //Application.Run(QUiConsoleForm.Instance);
            // 显示工作界面
            //QUiDesignForm form = RDesign2dManager.FrameConsole.OpenDesignForm("main.bar");
            //Application.Run(form);
            //QUiConsoleForm.Instance.Open();
            //QUiConsoleForm.Instance.Text += " - [" + configFileName + "] v131016";
            //Application.Run(QUiConsoleForm.Instance);
            //............................................................
            // 释放系统
            //RDesign2dManager.Release();
            //RContent2dManager.Release();
            RMoCore.Release();
            RMoCommon.Release();
        }
Exemplo n.º 4
0
        static void Main()
        {
            // 设置应用程序
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 初始化系统
            string location       = RSystem.Location();
            string configFileName = location + @"\..\Configuration\environment.mobile.xml";

            RMoCommon.Initialize();
            RMoCommon.LoadEnvironment(configFileName);

            Application.Run(QTemplateExportForm.Instance);
        }
Exemplo n.º 5
0
 public override void LoadConfig(FXmlNode config)
 {
     _fileName = config.Text;
     RString.CheckEmpty(_fileName, "fileName");
     _fileName = RSystem.Location(_fileName);
     if (!File.Exists(_fileName))
     {
         throw new FFatalException("Include file is not exists. (file={0})", _fileName);
     }
     if (_logger.DebugAble)
     {
         _logger.Debug(this, "LoadConfig", "Include file {0}", _fileName);
     }
     // Load include
     _console.LoadDocument(_fileName);
 }
Exemplo n.º 6
0
        static void Main()
        {
            // 设置应用程序
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 初始化系统
            RMoCommon.Initialize();
            RMoCore.Initialize();
            // 加载环境文件
            string environmentFileName = RSystem.Location(@"\..\Configuration\environment.sns.xml");

            RMoCommon.LoadEnvironment(environmentFileName);
            //............................................................
            // 加载配置文件
            string configFileName = RMoCommon.ParseEnvironment(@"${application.root}\Configuration\configuration.xml");

            using (FXmlDocument xdoc = new FXmlDocument(configFileName)) {
                FXmlNode xconfig = xdoc.Root;
                // 加载配置
                RMoCore.LoadConfig(xconfig);
                RDxCore.LoadConfig(xconfig);
                RContent2dManager.LoadConfig(xconfig);
                RContent3dManager.LoadConfig(xconfig);
                // 配置处理
                RMoCore.Setup();
                RContent3dManager.Open();
            }
            //............................................................
            try {
                // 打开跟踪表单
                //QTrackForm.Instance.Open();
                // 打开任务表单
                QTaskForm.Instance.Open();
                // 显示控制表单
                QDsConsoleForm.Instance.Open();
                Application.Run(QDsConsoleForm.Instance);
            } catch (FException e) {
                MessageBox.Show(e.Describe, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //............................................................
            // 释放系统
            RContent2dManager.Release();
            RMoCore.Release();
            RMoCommon.Release();
        }
Exemplo n.º 7
0
 //============================================================
 public void Close()
 {
     _initialized = false;
     RSystem.Collect();
 }
Exemplo n.º 8
0
 private void AddControlSystem(XmlElement xElementRoot, RSystem control)
 {
     this.AddControlText(xElementRoot, control);
     this.AddAtributo(xElementRoot, "SystemType", Convert.ToInt16(control.时间页码).ToString());
 }
Exemplo n.º 9
0
 private void ProcessSystem(XmlElement xElementControl, RSystem control)
 {
     control.时间页码 = (RSystemType)this.GetInteger(xElementControl.Attributes, "SystemType");
 }
Exemplo n.º 10
0
        public void Buy()
        {
            Item     item      = itemToSell.item;
            Player   player    = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
            Backpack backpack  = player.equipment.backpack;
            RSystem  rSystem   = player.equipment.rSystem;
            Trade    tradeInfo = item.tradeInfo;

            if (player && backpack != null)
            {
                // We check if the player has enough gold and blu to buy the item
                if (backpack.GetCurrencyAmount(Currency.Type.GOLD) >= tradeInfo.merchantCostGold)
                {
                    // We substract the cost of the item
                    backpack.GetCurrency(Currency.Type.GOLD).amount -= tradeInfo.merchantCostGold;

                    // We check if the items are Backpacks or C-Systems, since they are not added to a backpack, but replaces the current backpack or C-System (under Player.Equipment)
                    if (item.GetType() == typeof(Backpack))
                    {
                        // * ADDITION: Ask the player if he/she is sure to remove the current backpack *
                        // * ADDITION: Give the player the ability to switch its items to the new backpack he/she is about the buy *

                        // We replace any existing backpack with the new one
                        backpack = (Backpack)item;

                        Debug.Log("Player's BACKPACK has changed!");
                        Debug.Log(string.Format("{0} GOLD has been debited from the player...", tradeInfo.merchantCostGold));
                    }
                    else if (item.GetType() == typeof(RSystem))
                    {
                        // We replace any existing RSystem with the new one
                        rSystem = (RSystem)item;

                        // * ADDITION: Ask the player if he/she is sure to remove the current c-system *
                        // * NOTE: The csystem carries over automatically all the entities to the new one, the rift key/ID being the same one *

                        Debug.Log("Player's C-SYSTEM has changed!");
                        Debug.Log(string.Format("{0} GOLD has been debited from the player...", tradeInfo.merchantCostGold));
                    }
                    else
                    {
                        // ...Otherwise, we add the new item to the backpack list
                        ExitCode add = backpack.AddItem(itemToSell, tradeAmount);
                        if (add == ExitCode.Backpack_AmountIncreased)
                        {
                            // We display a message saying that the item was already in the backpack and its amount has increased
                            Debug.Log(string.Format("The item \"{0}\" is already in the backpack. The amount has increased by {1}.\nTotal amount: {2}", item.name, tradeAmount, itemToSell.amount));
                        }
                        else if (add == ExitCode.Backpack_Full)
                        {
                            // We display a message saying that the backpack is full and the item couldn't be added
                            Debug.Log(string.Format("Action of buying item \"{0}\" canceled... Backpack is full!", item.name));
                            return;
                        }
                    }

                    // Then, we remove the item from the list before destroying this object if amount = 0
                    merchantInterface.RemoveItem(itemToSell, tradeAmount);
                    // We destroy this game object, which will remove it from the npc interface
                    Destroy(this.gameObject);
                }
                else
                {
                    if (backpack.GetCurrency(Currency.Type.GOLD).amount < tradeInfo.merchantCostGold)
                    {
                        Debug.Log("The Player doesn'thave enough Gold to buy the item...");
                    }
                }
            }
            else
            {
                Debug.Log("Player couldn't be found in hierarchy...");
            }
        }
Exemplo n.º 11
0
 //============================================================
 public static void LoadConfig(string filename)
 {
     _configConsole.LoadDocument(RSystem.Location(filename));
 }