예제 #1
0
            public TagCompletionData(FF8TextTagCode code, IEnumerable values = null)
                : base(code)
            {
                if (values == null)
                {
                    return;
                }

                foreach (Enum value in values)
                {
                    DisplayAttribute data = GetDisplayAttribute(value);
                    if (data != null)
                    {
                        _values.Add(new CompletionData(value));
                    }
                }
            }
예제 #2
0
        public static FF8TextTag TryRead(Byte[] bytes, ref Int32 offset, ref Int32 left)
        {
            FF8TextTagCode code = (FF8TextTagCode)bytes[offset++];

            left -= 2;
            switch (code)
            {
            case FF8TextTagCode.End:
            case FF8TextTagCode.Next:
            case FF8TextTagCode.Line:
            case FF8TextTagCode.Speaker:
                left++;
                return(new FF8TextTag(code));

            case FF8TextTagCode.Pause:
            case FF8TextTagCode.Var:
                return(new FF8TextTag(code, (FF8TextTagParam)bytes[offset++]));

            case FF8TextTagCode.Char:
                return(new FF8TextTag(code, (FF8TextTagCharacter)bytes[offset++]));

            case FF8TextTagCode.Key:
                return(new FF8TextTag(code, (FF8TextTagKey)bytes[offset++]));

            case FF8TextTagCode.Color:
                return(new FF8TextTag(code, (FF8TextTagColor)bytes[offset++]));

            case FF8TextTagCode.Dialog:
                return(new FF8TextTag(code, (FF8TextTagDialog)bytes[offset++]));

            case FF8TextTagCode.Option:
                return(new FF8TextTag(code, (FF8TextTagOption)bytes[offset++]));

            case FF8TextTagCode.Term:
                return(new FF8TextTag(code, (FF8TextTagTerm)bytes[offset++]));

            default:
                left += 2;
                offset--;
                return(null);
            }
        }
예제 #3
0
 public FF8TextTag(FF8TextTagCode code, Enum param = null)
 {
     Code  = code;
     Param = param;
 }