コード例 #1
0
 private void ParseAnimation(IniParser parser)
 {
     if (parser.SageGame == SageGame.CncGenerals || parser.SageGame == SageGame.CncGeneralsZeroHour)
     {
         ConditionAnimations.Add(ObjectConditionAnimation.Parse(parser));
     }
     else
     {
         Animations.Add(Animation.Parse(parser));
     }
 }
コード例 #2
0
        internal static ObjectConditionAnimation Parse(IniParser parser)
        {
            var result = new ObjectConditionAnimation
            {
                Animation = parser.ParseAnimationName()
            };

            if (parser.Current.TokenType == IniTokenType.IntegerLiteral ||
                parser.Current.TokenType == IniTokenType.FloatLiteral)
            {
                result.Unknown1 = parser.ParseFloat();

                if (parser.Current.TokenType == IniTokenType.IntegerLiteral)
                {
                    result.Unknown2 = parser.ParseInteger();
                }
            }

            return(result);
        }
コード例 #3
0
        internal static ObjectConditionAnimation Parse(IniParser parser)
        {
            var result = new ObjectConditionAnimation();

            result.Animation = parser.ParseAnimationReference();

            var unknown1Token = parser.GetNextTokenOptional();

            if (unknown1Token != null)
            {
                result.Unknown1 = parser.ScanFloat(unknown1Token.Value);

                var unknown2Token = parser.GetNextTokenOptional();
                if (unknown2Token != null)
                {
                    result.Unknown2 = parser.ScanInteger(unknown2Token.Value);
                }
            }

            return(result);
        }