Пример #1
0
        //============================================================
        // <T>在Map表中查找类型对应的全名。</T>
        //
        // @param filenode 从文件中提取的待查找节点
        // @param type 类型
        // @return 查找到的全名
        //============================================================
        public string LookInMap(FFileNode filenode, string type)
        {
            string fullClassString = string.Empty;
            string key             = filenode.ClassStr;

            if (_classesMap.Contains(key))
            {
                FArray <string> value = _classesMap[key];
                if (_classesMap.Contains(key) && value.Length == 1)
                {
                    fullClassString = value[0].ToString();
                    if (fullClassString != string.Empty)
                    {
                        return(fullClassString + "." + type);
                    }
                    else
                    {
                        return(type);
                    }
                }
                if (_classesMap.Contains(key) && value.Length > 1)
                {
                    fullClassString = GetCorrectNamespace(filenode.Impotrs, value);
                    if (fullClassString != string.Empty)
                    {
                        return(fullClassString + "." + type);
                    }
                    else
                    {
                        return(type);
                    }
                }
            }
            return(type);
        }
Пример #2
0
        //============================================================
        // <T>绘制出生点。</T>
        //============================================================
        public void DrawBirths()
        {
            FObjects <FMbMapBirth> births = _map.Births;

            if (!births.IsEmpty())
            {
                int count = births.Count;
                for (int n = 0; n < count; n++)
                {
                    FMbMapBirth birth    = births[n];
                    SIntPoint2  location = birth.Location;
                    // 获取敌机集合
                    FObjects <FMbMapBirthEnemy> enemys = birth.BirthEnemys;
                    int enemyCount = enemys.Count;
                    for (int x = 0; x < enemyCount; x++)
                    {
                        FMbMapBirthEnemy birthEnemy = enemys[x];
                        int         templateId      = birthEnemy.TemplateId;
                        FMbTplEnemy enemy           = RMobileManager.TemplateConsole.EnemyConsole.FingById(templateId);
                        int         resourceRid     = enemy.ResourceRid;
                        // 获取资源图片
                        FRsResourcePicture resource    = RContent2dManager.ResourceConsole.FindOpen(resourceRid) as FRsResourcePicture;
                        Bitmap             resourceMap = resource.Bitmap.Native;
                        // 创建绘制对象
                        FDxBitmap bitmap = null;
                        if (!_dxBitmapSet.Contains(resourceRid.ToString()))
                        {
                            bitmap = _context.Device.CreateBitmap(resourceMap);
                            _dxBitmapSet.Set(resourceRid.ToString(), bitmap);
                        }
                        else
                        {
                            bitmap = _dxBitmapSet.Get(resourceRid.ToString());
                        }
                        _context.DrawBitmap(bitmap, location.X - _location.X, location.Y - _location.Y);
                    }
                }
            }
        }
Пример #3
0
        //============================================================
        // <T>在MAP表中查找对应值。</T>
        //
        // @param filenode 在文件中生成的查找节点。
        // @return 查找到的值
        //============================================================
        public string LookInMap(FFileNode filenode)
        {
            FArray <string> heads = new FArray <string>();

            heads = filenode.HeadHS;
            string classstr = filenode.ClassStr;

            foreach (string head in heads)
            {
                if (_classesMap.Contains(head))
                {
                    if (_classesMap[head].Contains(classstr))
                    {
                        return(_classesMap[head][0].Trim());
                    }
                }
            }
            return(string.Empty);
        }