private void Initialize() { for (int i = 0; i < _actionCount; i++) { uint _crc = (uint)Util.GetWordUnsafe(_workingSource.Address + 0x10 + (i * 8), Endian); int _offset = Util.GetWordUnsafe((_workingSource.Address + 0x10 + (i * 8)) + 0x04, Endian); EventLists.Add(_crc, ParseEventList(_crc, _offset)); } }
public ACMDFile(DataSource source) : this() { _workingSource = source; _actionCount = Util.GetWordUnsafe(source.Address + 0x08, Runtime.WorkingEndian); _commandCount = Util.GetWordUnsafe(source.Address + 0x0C, Runtime.WorkingEndian); for (int i = 0; i < _actionCount; i++) { uint _crc = (uint)Util.GetWordUnsafe(_workingSource.Address + 0x10 + (i * 8), Runtime.WorkingEndian); int _offset = Util.GetWordUnsafe((_workingSource.Address + 0x10 + (i * 8)) + 0x04, Runtime.WorkingEndian); EventLists.Add(_crc, ParseEventList(_crc, _offset)); } }
public ACMDFile(DataSource source) : this() { _workingSource = source; if (*(byte *)(source.Address + 0x04) == 0x02) { Endian = Endianness.Little; } else if ((*(byte *)(source.Address + 0x04) == 0x00)) { Endian = Endianness.Big; } ActionCount = Util.GetWordUnsafe(source.Address + 0x08, Endian); CommandCount = Util.GetWordUnsafe(source.Address + 0x0C, Endian); for (int i = 0; i < ActionCount; i++) { uint _crc = (uint)Util.GetWordUnsafe(_workingSource.Address + 0x10 + (i * 8), Endian); int _offset = Util.GetWordUnsafe((_workingSource.Address + 0x10 + (i * 8)) + 0x04, Endian); EventLists.Add(_crc, ParseEventList(_crc, _offset)); } }
public override void RegisterEvents() { EventLists.Add(FBConsts.E_SceneEnter); }
public override void ParseData(JObject data, int requestType = 0) { if (data["result"] != null) { JToken result = (JToken)data["result"]; switch (requestType) { case (int)TrainingReqType.GET_DETECTION_INFO: // Store actions lists // Training Action JArray jActionsArr = (JArray)result["actions"]; foreach (var item in jActionsArr) { ActionLists.Add((string)item); } // Training Control JArray jControlArr = (JArray)result["controls"]; foreach (var item in jControlArr) { ControlLists.Add((string)item); } // Training Events JArray jEventArr = (JArray)result["events"]; foreach (var item in jEventArr) { EventLists.Add((string)item); } break; case (int)TrainingReqType.CREATE_NEW_PROFILE: Console.WriteLine("Create Profile Successfully"); break; case (int)TrainingReqType.LOAD_PROFILE: IsLoaded = true; Console.WriteLine("Load Profile Successfully"); break; case (int)TrainingReqType.SAVE_PROFILE: Console.WriteLine("Save Profile Successfully"); break; case (int)TrainingReqType.UPLOAD_PROFILE: Console.WriteLine("Upload Profile Successfully"); break; case (int)TrainingReqType.QUERY_PROFILE_LIST: Console.WriteLine("Querry Profile Successfully"); JArray jProfileArr = (JArray)result; List <string> profileLists = new List <string>(); foreach (var item in jProfileArr) { profileLists.Add((string)item); } if (profileLists.Count > 0) { ProfileLists = profileLists.ToList(); } else { ProfileLists.Clear(); } break; case (int)TrainingReqType.MCC_START: case (int)TrainingReqType.MCC_ACCEPT: case (int)TrainingReqType.MCC_REJECT: case (int)TrainingReqType.MCC_RESET: Console.WriteLine("Mental Command Training: " + (string)result); break; case (int)TrainingReqType.FE_START: case (int)TrainingReqType.FE_ACCEPT: case (int)TrainingReqType.FE_REJECT: case (int)TrainingReqType.FE_RESET: Console.WriteLine("Facial Expression Training: " + (string)result); break; default: break; } } }
public override void RegisterEvents() { EventLists.Add(FBConsts.E_ShowTowerCreat); EventLists.Add(FBConsts.E_ShowTowerUpgrade); EventLists.Add(FBConsts.E_TowerHide); }