Example #1
0
        public void SetParameterBytes(byte[] data)
        {
            ChaFileParameter src = (ChaFileParameter)MessagePackSerializer.Deserialize <ChaFileParameter>(data);

            src.ComplementWithVersion();
            this.parameter.Copy(src);
        }
Example #2
0
 public ChaFile()
 {
     this.custom            = new ChaFileCustom();
     this.coordinate        = new ChaFileCoordinate();
     this.parameter         = new ChaFileParameter();
     this.gameinfo          = new ChaFileGameInfo();
     this.status            = new ChaFileStatus();
     this.lastLoadErrorCode = 0;
 }
 public void Copy(ChaFileParameter src)
 {
     this.version     = src.version;
     this.sex         = src.sex;
     this.fullname    = src.fullname;
     this.personality = src.personality;
     this.birthMonth  = src.birthMonth;
     this.birthDay    = src.birthDay;
     this.voiceRate   = src.voiceRate;
     this.hsWish      = new HashSet <int>((IEnumerable <int>)src.hsWish);
     this.futanari    = src.futanari;
 }
Example #4
0
        public static bool CheckDataRangeParameter(ChaFile chafile, List <string> checkInfo = null)
        {
            ChaListControl   chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
            ChaFileParameter parameter   = chafile.parameter;
            bool             flag        = false;

            if (parameter.sex == (byte)0)
            {
                return(false);
            }
            if (!Singleton <Manager.Voice> .Instance.voiceInfoDic.ContainsKey(parameter.personality))
            {
                checkInfo?.Add(string.Format("【性格】値:{0}", (object)parameter.personality));
                flag = true;
                parameter.personality = 0;
            }
            return(flag);
        }
Example #5
0
 public void CopyParameter(ChaFileParameter _parameter)
 {
     this.SetParameterBytes(ChaFile.GetParameterBytes(_parameter));
 }
Example #6
0
 public static byte[] GetParameterBytes(ChaFileParameter _parameter)
 {
     return(MessagePackSerializer.Serialize <ChaFileParameter>((M0)_parameter));
 }