Exemplo n.º 1
0
 public static void StorePostureToFile(this MAvatarPosture p, string filepath)
 {
     if (!Directory.Exists(Path.GetDirectoryName(filepath)))
     {
         Directory.CreateDirectory(Path.GetDirectoryName(filepath));
     }
 }
Exemplo n.º 2
0
        public static MAvatarPosture LoadMAvatarPostureFromFile(string filepath, string AvatarID)
        {
            string[]      lines        = (string[])File.ReadLines(filepath);
            List <MJoint> jointList    = new List <MJoint>();
            int           line_counter = 0;

            ParseJoint(lines, ref line_counter, jointList);

            MAvatarPosture ret = new MAvatarPosture(AvatarID, jointList);

            return(ret);
        }
Exemplo n.º 3
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_AvatarID    = false;
                bool   isset_ZeroPosture = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.String)
                        {
                            AvatarID       = iprot.ReadString();
                            isset_AvatarID = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            ZeroPosture = new MAvatarPosture();
                            ZeroPosture.Read(iprot);
                            isset_ZeroPosture = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Map)
                        {
                            {
                                Properties = new Dictionary <string, string>();
                                TMap _map25 = iprot.ReadMapBegin();
                                for (int _i26 = 0; _i26 < _map25.Count; ++_i26)
                                {
                                    string _key27;
                                    string _val28;
                                    _key27             = iprot.ReadString();
                                    _val28             = iprot.ReadString();
                                    Properties[_key27] = _val28;
                                }
                                iprot.ReadMapEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_AvatarID)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field AvatarID not set");
                }
                if (!isset_ZeroPosture)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ZeroPosture not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Exemplo n.º 4
0
 public MAvatarDescription(string AvatarID, MAvatarPosture ZeroPosture) : this()
 {
     this.AvatarID    = AvatarID;
     this.ZeroPosture = ZeroPosture;
 }