Beispiel #1
0
        public void Visit(ActionLayerDef actionLayerDef, object[] args)
        {
            //reader.Read();
            //reader.MoveToContent();
            reader.MoveToAttribute("position");

            actionLayerDef.Position = PositionData.Parse(reader.Value);

            //reader.Read();  //</ActionLayer>
        }
Beispiel #2
0
        public void Visit(ActorStmt actorStmt, object[] args)
        {
            //TODO: 参数字串
            if (reader.MoveToAttribute("name"))
            {
                actorStmt.Name = reader.Value;
            }

            //FINISH: 检查
            bool imgDefined;

            if (imgDefined = reader.MoveToAttribute("img"))
            {
                actorStmt.Img = reader.Value;
            }

            bool assetDefined;

            if (assetDefined = reader.MoveToAttribute("asset"))
            {
                actorStmt.Asset = reader.Value;
            }

            if (imgDefined && assetDefined)
            {
                kernel.IssueError(ErrorType.BothSrcAndAsset, new Location(file, reader.LineNumber, reader.LinePosition));
            }

            bool avatarDefined;

            if (avatarDefined = reader.MoveToAttribute("avatar"))
            {
                actorStmt.Avatar = reader.Value;
            }
            bool avaassetDefined;

            if (avaassetDefined = reader.MoveToAttribute("avaasset"))
            {
                actorStmt.AvaAsset = reader.Value;
            }
            if (avatarDefined && avaassetDefined)
            {
                kernel.IssueError(ErrorType.BothSrcAndAsset, new Location(file, reader.LineNumber, reader.LinePosition));
            }

            //FINISH: 检查存在性
            bool layerDefined;

            if (layerDefined = reader.MoveToAttribute("layer"))
            {
                actorStmt.Layer = reader.Value;
            }

            bool posDefined;

            if (posDefined = reader.MoveToAttribute("position"))
            {
                actorStmt.Position = PositionData.Parse(reader.Value);
            }

            if (layerDefined && posDefined)
            {
                kernel.IssueError(ErrorType.BothActorLayerAndCustom, new Location(file, reader.LineNumber, reader.LinePosition));
            }
        }