Esempio n. 1
0
        /// <summary>
        ///AddMap 的测试
        ///</summary>
        public void AddMapTestHelper <MapT>()
            where MapT : BaseMap
        {
            MapManager <MapT> target = new MapManager <MapT>(); // TODO: 初始化为适当的值
            Serial            mapId  = new Serial();            // TODO: 初始化为适当的值
            MapT addMap = default(MapT);                        // TODO: 初始化为适当的值

            target.AddMap(mapId, addMap);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 2
0
        /// <summary>
        /// Load the flyff maps specified in the configuration file.
        /// </summary>
        private void LoadMaps()
        {
            Log.Loading("Loading maps...");

            IEnumerable <MapConfiguration> maps = this.WorldConfiguration.Maps;

            foreach (var map in maps)
            {
                Log.Loading("Loading map '{0}'...", map.Name);
                var newMap = new Map(map.Id, map.Name);
                newMap.Load();
                newMap.StartThread();

                MapManager.AddMap(newMap);
            }

            Log.Done("{0} maps loaded!\t\t\t", MapManager.Count);
        }
 public void NewMap()
 {
     mapmanager.AddMap();
     LoadBuildAssetMainMenuData();
 }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            AddressAndPort from = new AddressAndPort()
            {
                Address = textBox1.Text.Trim(), Port = (int)numericUpDown1.Value
            };

            if (!listBox1.Items.Contains(from))
            {
                AddressAndPort to = new AddressAndPort()
                {
                    Address = textBox2.Text.Trim(), Port = (int)numericUpDown2.Value
                };
                List <AddressAndPort> tos = new List <AddressAndPort>();
                tos.Add(to);
                int id = MapManager.AddMap(new KeyValuePair <AddressAndPort, List <AddressAndPort> >(from, tos), textBox3.Text.Trim());
                if (id > 0)
                {
                    AddressMap map = listBox1.Tag as AddressMap;
                    map.Add(id, from, to, textBox3.Text.Trim());
                    listBox1.Items.Add(from);
                    listBox2.Items.Add(to);
                    if (MessageBox.Show("添加映射成功!是否为双向映射?确定将自动为您添加一个反向映射。", "添加成功和双向提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        AddressAndPort from2 = new AddressAndPort()
                        {
                            Address = textBox2.Text.Trim(), Port = (int)numericUpDown2.Value
                        };
                        if (!listBox1.Items.Contains(from2))
                        {
                            AddressAndPort to2 = new AddressAndPort()
                            {
                                Address = textBox1.Text.Trim(), Port = (int)numericUpDown1.Value
                            };
                            List <AddressAndPort> tos2 = new List <AddressAndPort>();
                            tos2.Add(to2);
                            id = MapManager.AddMap(new KeyValuePair <AddressAndPort, List <AddressAndPort> >(from2, tos2), textBox3.Text.Trim() + "_反向");
                            if (id > 0)
                            {
                                map.Add(id, from2, to2, textBox3.Text.Trim() + "_反向");
                                listBox1.Items.Add(from2);
                                listBox2.Items.Add(to2);
                                MessageBox.Show("添加反向映射成功!");
                            }
                        }
                        else
                        {
                            MessageBox.Show("已存在该映射起点[" + from2 + "],请点击修改按钮!");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("添加映射失败!");
                }
                MapManager.Dispose();
            }
            else
            {
                MessageBox.Show("已存在该映射起点[" + from + "],请点击修改按钮!");
            }
        }