コード例 #1
0
ファイル: FDrMap.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>存储配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        public void SaveConfig(FXmlNode config)
        {
            // 设置信息
            config.Set("id", _id);
            config.Set("name", _name);
            config.Set("layer_count", _layerCount);
            config.Set("size", _size.ToString());
            config.Set("range", _range.ToString());
            config.Set("deep", _deep);
            //............................................................
            // 存储高度纹理
            FXmlNode xheight = config.CreateNode("Height");

            xheight.Set("source", _textureHeight);
            // 存储颜色纹理
            FXmlNode xcolor = config.CreateNode("Color");

            xcolor.Set("source", _textureColor);
            //............................................................
            // 存储层信息
            FXmlNode xlayers = config.CreateNode("Layers");

            if (null != xlayers)
            {
                foreach (FDrMapLayer layer in _layers)
                {
                    FXmlNode xlayer = xlayers.CreateNode("Layer");
                    layer.SaveConfig(xlayer);
                }
            }
        }
コード例 #2
0
        //============================================================
        // <T>存储配置信息。</T>
        //
        // @param xconfig 配置信息
        //============================================================
        public void SaveConfig(FXmlNode xconfig)
        {
            // 存储属性
            xconfig.Set("type_name", _typeName);
            // 存储配置
            xconfig.Set("option_track", _optionTrack);
            // 存储阴影
            FXmlNode xshadow = xconfig.CreateNode("Shadow");

            _shadow1.SaveConfig(xshadow, "1");
            _shadow2.SaveConfig(xshadow, "2");
            _shadow3.SaveConfig(xshadow, "3");
            xshadow.Set("ambient_min", _shadowAmbientMin);
            xshadow.Set("ambient_max", _shadowAmbientMax);
            xshadow.Set("ambient_thick", _shadowAmbientThick);
            xshadow.Set("ambient_range", _shadowAmbientRange);
            xshadow.Set("merge1_base", _shadowMerge1Base);
            xshadow.Set("merge1_rate", _shadowMerge1Rate);
            xshadow.Set("merge2_base", _shadowMerge2Base);
            xshadow.Set("merge2_rate", _shadowMerge2Rate);
            // 存储材质
            _material.SaveConfig(xconfig.CreateNode("Material"));
            // 存储相机
            _camera.SaveConfig(xconfig.CreateNode("Camera"));
        }
コード例 #3
0
ファイル: FSchedule.cs プロジェクト: whztt07/MoCross
 public void SaveConfig(FXmlNode config)
 {
     config.Set(PTY_VALID, _valid);
     config[PTY_ID]   = _id;
     config[PTY_TEXT] = _text;
     // Save tasks
     _tasks.SaveConfig(config.CreateNode(FScheduleTasks.NAME));
     // Save events
     _events.SaveConfig(config.CreateNode(FScheduleEvents.NAME));
     // Save conditions
     _conditions.SaveConfig(config.CreateNode(FScheduleConditions.NAME));
 }
コード例 #4
0
ファイル: FDsMap.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>保存配置文件。</T>
        //============================================================
        public void SaveFile()
        {
            FXmlDocument xmldoc = new FXmlDocument();
            FXmlNode     node   = xmldoc.Root;

            node.Name = "Map";
            node.Set("tid", _resource.Tid);
            node.Set("name", _resource.Name);
            node.Set("label", _resource.Label);
            node.Set("map_size", _resource.Size.ToString());
            // 保存出生点
            FXmlNode birthsNode = node.CreateNode("Births");

            foreach (FMbMapBirth birth in _resource.Births)
            {
                FXmlNode birthNode = birthsNode.CreateNode("Birth");
                birthNode.Set("location", birth.Location.ToString());
                foreach (FMbMapBirthEnemy enemy in birth.BirthEnemys)
                {
                    FXmlNode enemyNode = birthNode.CreateNode("BirthEnemy");
                    enemyNode.Set("template_id", enemy.TemplateId);
                }
            }

            // 保存层
            FXmlNode layersNode = node.CreateNode("Layers");

            foreach (FMbMapLayer layer in _resource.Layers)
            {
                FXmlNode layerNode = layersNode.CreateNode("Layer");
                layerNode.Set("cell_count", layer.CellCount.ToString());
                layerNode.Set("cell_size", layer.CellSize.ToString());
                layerNode.Set("scroll_cd", layer.ScrollCd.ToString());
                layerNode.Set("type_cd", layer.TypeCd.ToString());
                layerNode.Set("scroll_speed", layer.ScrollSpeed);
                layerNode.Set("wrap_cd", layer.WrapCd.ToString());
                FXmlNode cellsNode = layerNode.CreateNode("Tiles");
                foreach (FMbMapCell cell in layer.MapCell)
                {
                    if (0 == cell.ResourceId)
                    {
                        continue;
                    }
                    FXmlNode cellNode = cellsNode.CreateNode("Tile");
                    cellNode.Set("index", cell.Index.ToString());
                    cellNode.Set("resource_id", cell.ResourceId);
                }
            }

            xmldoc.SaveFile(_resource.Directory + "\\config.xml");
        }
コード例 #5
0
ファイル: FDrModel.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>保存设置信息。</T>
        //
        // @param 配置节点
        //============================================================
        public void SaveInfoConfig(FXmlNode xconfig)
        {
            // 存储属性
            xconfig.Set("name", _name);
            xconfig.Set("label", _label);
            // 存储网格信息
            FXmlNode xmesh = xconfig.CreateNode("Mesh");

            _mesh.SaveInfoConfig(xmesh);
            // 存储动画信息
            FXmlNode xanimation = xconfig.CreateNode("Animation");

            _animation.SaveConfig(xanimation);
        }
コード例 #6
0
 //============================================================
 // <T>存储配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void SaveConfig(FXmlNode xconfig)
 {
     // 存储属性
     xconfig.Set("theme_code", _themeName);
     // 存储技术信息
     _technique.SaveConfig(xconfig.CreateNode("Technique"));
     // 存储区域信息
     _region.SaveConfig(xconfig.CreateNode("Region"));
     // 存储天空信息
     _sky.SaveConfig(xconfig.CreateNode("Sky"));
     // 存储地图信息
     _map.SaveConfig(xconfig.CreateNode("Map"));
     // 存储空间信息
     _space.SaveConfig(xconfig.CreateNode("Space"));
 }
コード例 #7
0
 //============================================================
 // <T>存储配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void SaveConfig(FXmlNode xconfig)
 {
     foreach (FDrSceneDisplay display in _displays)
     {
         display.SaveConfig(xconfig.CreateNode("Display"));
     }
 }
コード例 #8
0
 //============================================================
 // <T>存储配置信息。</T>
 //
 // @param config 配置信息
 //============================================================
 public void SaveConfig(FXmlNode xconfig)
 {
     foreach (FDrTemplateAnimationMovie movie in _movies)
     {
         movie.SaveConfig(xconfig.CreateNode("Movie"));
     }
 }
コード例 #9
0
        //=============================================================
        public void SaveXmlPath(string fileName, string rootname)
        {
            FXmlDocument xml  = new FXmlDocument();
            FXmlNode     root = xml.Root;

            root.Name = rootname + "List";
            string id  = _columns[0].Name;
            string rid = null;

            foreach (FXlsRow row in _rows)
            {
                FXmlNode node = root.CreateNode("node");
                foreach (string name in row.Names)
                {
                    string excel = name;
                    string value = row[excel].ToString();
                    if (id == excel)
                    {
                        rid = value;
                    }
                    node.Set(excel, value);
                    node.Name = rootname;
                }
            }
            xml.SaveFile(fileName);
            _logger.Debug(this, "SaveXmlPath", "Save xml path. (file={0}, rows={1})", fileName, _rows.Count);
        }
コード例 #10
0
ファイル: FRsResourceClip.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>保存设置信息。<T>
        //
        // @param xconfig 设置节点
        //============================================================
        public void SaveConfig(FXmlNode xconfig)
        {
            xconfig.Set("is_reversed", _isReversed);
            // 设置剪辑反转方向
            xconfig.Set("reverse_direction", (int)_reverseDirection);
            // 设置方向
            xconfig.Set("direction_cd", (int)_directionCd);
            // 设置有效重心
            xconfig.Set("valid_barycenter", _validBarycenter.ToString());
            // 设置延时
            xconfig.Set("frame_delay", _frameDelay);
            //设置相关信息
            xconfig.Set("blood", _bloodPoint.ToString());
            xconfig.Set("ride_point", _ridePoint.ToString());
            xconfig.Set("is_check", _isCheckd.ToString());
            // 读取帧数
            FXmlNode xframes = xconfig.CreateNode("Frames");

            xframes.Set("count", _frames.Count);
            // 读取剪辑集合
            foreach (FRsResourceFrame frame in _frames)
            {
                frame.SaveConfig(xframes.CreateNode("Frame"));
            }
        }
コード例 #11
0
        //============================================================
        // <T>生成节点时,将此对象生成的节点连接到上层节点上</T>
        // @param config 需要连接的父节点。
        // @return 本对象生成的节点。
        //============================================================
        public FXmlNode XMLMaker(FXmlNode config)
        {
            FXmlNode node = config.CreateNode("NameSpace");

            node.Set("name", this.SpaceName);
            return(node);
        }
コード例 #12
0
ファイル: FDrAnimation.cs プロジェクト: whztt07/MoCross
 //============================================================
 // <T>存储配置信息。</T>
 //
 // @param config 配置信息
 //============================================================
 public void SaveConfig(FXmlNode config)
 {
     foreach (FDrMovie movie in _movies)
     {
         movie.SaveConfig(config.CreateNode("Movie"));
     }
 }
コード例 #13
0
ファイル: FDrResourceGroup.cs プロジェクト: whztt07/MoCross
 //============================================================
 // <T>序列化资源信息。</T>
 //
 // @param output 流信息
 //============================================================
 public virtual void Serialize(IOutput output, FXmlNode config)
 {
     // 写入编号
     output.WriteString(_code);
     //............................................................
     output.WriteInt16((short)_resources.Count);
     foreach (FDrResource resource in _resources)
     {
         resource.Open();
         // 序列化资源
         FByteStream stream = new FByteStream();
         resource.Serialize(stream);
         // 输出资源
         output.WriteInt32(stream.Length);
         output.WriteBytes(stream.Memory, 0, stream.Length);
         // 创建资源设置
         if (null != config)
         {
             FXmlNode xresource = config.CreateNode("Resource");
             xresource.Set("code", resource.Code);
             xresource.Set("label", resource.Label);
             xresource.Set("length", stream.Length);
         }
     }
 }
コード例 #14
0
        //============================================================
        // <T>保存设置信息。<T>
        //
        // @param xconfig 设置节点
        //============================================================
        public override void SaveConfig(FXmlNode xconfig)
        {
            base.SaveConfig(xconfig);
            // 设置文件属性
            xconfig.Set("option_alpha", _optionAlpha);
            // 设置支持空白
            xconfig.Set("option_padding", _optionPadding);
            // 设置品质类型
            xconfig.SetNvl("quality_cd", _qualityCd);
            // 设置品质调色板
            xconfig.Set("quality_palette", _qualityPalette);
            // 设置品质透明
            xconfig.Set("quality_alpha", _qualityAlpha);
            // 存储帧延时
            xconfig.Set("frame_delay", _frameDelay);
            // 存储剪辑集合
            FXmlNode xclip = xconfig.CreateNode("Clips");

            foreach (FRsResourceClip clip in _clips)
            {
                if (clip != null)
                {
                    clip.SaveConfig(xclip.CreateNode("Clip"));
                }
            }
        }
コード例 #15
0
        //============================================================
        // <T>保存设置文件。</T>
        //============================================================
        public void SaveConfigFile(string fileName)
        {
            FXmlDocument xdoc  = new FXmlDocument();
            FXmlNode     xroot = xdoc.Root;

            SaveConfig(xroot.CreateNode("Texture"));
            xdoc.SaveFile(fileName);
        }
コード例 #16
0
ファイル: FDrMesh.cs プロジェクト: whztt07/MoCross
 //============================================================
 public void ExportConfig(FXmlNode config)
 {
     foreach (INamePair <FDrGeometry> pair in _geometryDictionary)
     {
         FXmlNode node = config.CreateNode("Geometry");
         pair.Value.ExportConfig(node);
     }
 }
コード例 #17
0
ファイル: FDrMesh.cs プロジェクト: whztt07/MoCross
 //============================================================
 // <T>保存全部配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void SaveInfoConfig(FXmlNode xconfig)
 {
     foreach (INamePair <FDrGeometry> pair in _geometryDictionary)
     {
         pair.Value.SaveInfoConfig(xconfig.CreateNode("Geometry"));
     }
     xconfig.SortByAttribute("name");
 }
コード例 #18
0
        //============================================================
        // <T>保存配置文件。</T>
        //============================================================
        public void SaveConfig(FXmlNode config)
        {
            FXmlNode layerNode = config.CreateNode("Layer");

            layerNode.Set("cell_count", _resource.CellCount.ToString());
            layerNode.Set("cell_size", _resource.CellSize.ToString());
            FXmlNode tilesNode = layerNode.CreateNode("Tiles");
        }
コード例 #19
0
ファイル: FDrMaterialBase.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>存储配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        public void SaveConfig(FXmlNode config)
        {
            config.Set("name", _name);
            config.Set("label", _label);
            FXmlNode xambient = config.CreateNode("Ambient");

            _ambientColor.SaveConfig(xambient, "r", "g", "b", "power");
        }
コード例 #20
0
        //============================================================
        // <T>存储配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        public void SaveConfig(FXmlNode xconfig)
        {
            // 设置信息
            xconfig.Set("name", _name);
            xconfig.Set("label", _label);
            xconfig.Set("option_loaded", _optionLoaded);
            xconfig.Set("option_select", _optionSelect);
            xconfig.Set("option_ground", _optionGround);
            xconfig.Set("option_merge_vertex", _optionMergeVertex);
            xconfig.Set("option_merge_material", _optionMergeMaterial);
            xconfig.Set("option_light_map", _optionLightMap);
            //............................................................
            // 存储渲染列表
            if (!_renderables.IsEmpty)
            {
                FXmlNode xrenderables = xconfig.CreateNode("Renderables");
                int      count        = _renderables.Count;
                xrenderables.Set("count", count);
                for (int n = 0; n < count; n++)
                {
                    FDrTemplateRenderable renderable = _renderables[n];
                    if (renderable.Id == 0)
                    {
                        renderable.Id = n + 1;
                    }
                    renderable.SaveConfig(xrenderables.CreateNode("Renderable"));
                }
            }
            //............................................................
            // 存储引用列表
            if (!_references.IsEmpty)
            {
                FXmlNode xreferences = xconfig.CreateNode("References");
                xreferences.Set("count", _references.Count);
                foreach (FDrTemplateReference reference in _references)
                {
                    reference.SaveConfig(xreferences.CreateNode("Renderable"));
                }
            }
            //............................................................
            // 存储引动画列表
            FXmlNode xanimation = xconfig.CreateNode("Animation");

            _animation.SaveConfig(xanimation);
        }
コード例 #21
0
ファイル: FDrFace.cs プロジェクト: whztt07/MoCross
        //============================================================
        public void ExportConfig(FXmlNode config)
        {
            // 输出顶点列表
            FXmlNode positionNode = config.CreateNode("VertexIndex");

            positionNode.Set("v1", _adjustVertexIndex.V1);
            positionNode.Set("v2", _adjustVertexIndex.V2);
            positionNode.Set("v3", _adjustVertexIndex.V3);
        }
コード例 #22
0
ファイル: FTplTheme.cs プロジェクト: whztt07/MoCross
 //============================================================
 // <T>存储设置节点。</T>
 //
 // @param xconfig 配置节点
 //============================================================
 public void SaveConfig(FXmlNode xconfig)
 {
     xconfig.Set("name", _name);
     // 保存样式集合
     foreach (INamePair <FTplThemeStyle> pair in _styles)
     {
         pair.Value.SaveConfig(xconfig.CreateNode("Style"));
     }
 }
コード例 #23
0
 //============================================================
 // <T>存储设置节点。</T>
 //
 // @param xconfig 配置节点
 //============================================================
 public override void SaveConfig(FXmlNode xconfig)
 {
     base.SaveConfig(xconfig);
     foreach (FTplConstant constant in _constants)
     {
         FXmlNode xnode = xconfig.CreateNode("Constant");
         constant.SaveConfig(xnode);
     }
 }
コード例 #24
0
ファイル: FDrMap.cs プロジェクト: whztt07/MoCross
        //============================================================
        public void SaveConfigFile(string fileName)
        {
            FXmlDocument xdoc  = new FXmlDocument();
            FXmlNode     xroot = xdoc.Root;

            SaveConfig(xroot.CreateNode("Map"));
            xdoc.SaveFile(fileName);
            _logger.Debug(this, "SaveConfigFile", "Save map config success. (file_name={0})", fileName);
        }
コード例 #25
0
 //============================================================
 // <T>存储设置节点。</T>
 //
 // @param xconfig 配置节点
 //============================================================
 public override void SaveConfig(FXmlNode xconfig)
 {
     base.SaveConfig(xconfig);
     foreach (FTplStyle style in _styles)
     {
         FXmlNode xnode = xconfig.CreateNode("Style");
         style.SaveConfig(xnode);
     }
 }
コード例 #26
0
 //============================================================
 public void SaveConfig(FXmlNode config)
 {
     foreach (INamePair <FDrMaterialGroup> pair in _names)
     {
         FXmlNode materialNode = config.CreateNode("Material");
         pair.Value.SaveConfig(materialNode);
     }
     config.SortByAttribute("name");
 }
コード例 #27
0
        //============================================================
        public void ExportScene()
        {
            FXmlDocument xdoc   = new FXmlDocument();
            FXmlNode     xscene = xdoc.Root;

            xscene.Name = "Scene";
            // 创建区域
            FXmlNode xregion = xscene.CreateNode("Region");

            xregion.Set("technique", "shadow");
            // 创建相机
            FXmlNode xcamera = xregion.CreateNode("Camera");

            xcamera.Set("type", "perspective");
            FXmlNode xviewport = xcamera.CreateNode("Viewport");

            xviewport.Set("angle", "45");
            xviewport.Set("znear", "1");
            xviewport.Set("zfar", "500");
            FXmlNode xposition = xcamera.CreateNode("Position");

            xposition.Set("x", "0");
            xposition.Set("y", "0");
            xposition.Set("z", "0");
            FXmlNode xtarget = xcamera.CreateNode("Target");

            xtarget.Set("x", "0");
            xtarget.Set("y", "0");
            xtarget.Set("z", "100");
            // 创建光源
            FXmlNode xlight = xregion.CreateNode("Light");

            xlight.Set("type", "directional");
            // 创建区域
            FXmlNode xspace = xscene.CreateNode("Space");
            FXmlNode xnode  = xspace.CreateNode("Node");

            xnode.Set("valid", "Y");
            xnode.Set("type", "still");
            FXmlNode xdisplay = xnode.CreateNode("Display");

            xdisplay.Set("valid", "Y");
            xdisplay.Set("src", Name);
        }
コード例 #28
0
        //=============================================================
        public void SaveDefineXmlPath(string fileName, string rootname)
        {
            FXmlDocument xml        = new FXmlDocument();
            FXmlNode     root       = xml.Root;
            FXmlNode     defineNode = root.CreateNode("Define");

            foreach (FXlsColumn value in _columns.Values)
            {
                FXmlNode node = defineNode.CreateNode("Field");
                node.GetInteger("");
                node.SetNvl("id", value.Id);
                node.SetNvl("label", value.Label);
                node.SetNvl("name", value.Name);
                node.SetNvl("type", value.Type);
                node.SetNvl("data_type", value.DataType);
                node.SetNvl("translate", value.Translate);
                node.SetNvl("length", value.Lenth);
                node.SetNvl("total", value.Total);
                node.SetNvl("note", value.Note);
            }
            FXmlNode dataNode = root.CreateNode(rootname + "List");
            string   id       = _columns[0].Name;
            string   rid      = null;

            foreach (FXlsRow row in _rows)
            {
                FXmlNode node = dataNode.CreateNode("node");
                foreach (string name in row.Names)
                {
                    string excel = name;
                    string value = row[excel].ToString();
                    if (id == excel)
                    {
                        rid = value;
                    }
                    node.Set(excel, value);
                    node.Name = rootname;
                }
            }
            xml.SaveFile(fileName);
            _logger.Debug(this, "SaveXmlPath", "Save xml path. (file={0}, rows={1})", fileName, _rows.Count);
        }
コード例 #29
0
 public void SaveConfig(FXmlNode config)
 {
     // Save tasks
     if (!IsEmpty())
     {
         foreach (FScheduleTask task in this)
         {
             task.SaveConfig(config.CreateNode(FScheduleTask.NAME));
         }
     }
 }
コード例 #30
0
 public void SaveConfig(FXmlNode config)
 {
     // Save events
     if (!IsEmpty())
     {
         foreach (FScheduleEvent scheduleEvent in this)
         {
             scheduleEvent.SaveConfig(config.CreateNode(FScheduleEvent.NAME));
         }
     }
 }