public static MNWSRoomListItem MNWSRoomListItemFromDictionary(IDictionary deserializedObject) { if (deserializedObject == null) { return null; } MNWSRoomListItem typedResult = new MNWSRoomListItem(); typedResult.GameId = ((deserializedObject["GameId"] == null) ? null : (int?)Convert.ToInt32(deserializedObject["GameId"])); typedResult.GameSetId = ((deserializedObject["GameSetId"] == null) ? null : (int?)Convert.ToInt32(deserializedObject["GameSetId"])); typedResult.RoomIsLobby = ((deserializedObject["RoomIsLobby"] == null) ? null : (bool?)Convert.ToBoolean(deserializedObject["RoomIsLobby"])); typedResult.RoomName = (string)deserializedObject["RoomName"]; typedResult.RoomSFId = ((deserializedObject["RoomSFId"] == null) ? null : (int?)Convert.ToInt32(deserializedObject["RoomSFId"])); typedResult.RoomUserCount = ((deserializedObject["RoomUserCount"] == null) ? null : (int?)Convert.ToInt32(deserializedObject["RoomUserCount"])); return typedResult; }
public static Hashtable MNWSRoomListItemToDictionary(MNWSRoomListItem srcObject) { Hashtable result = new Hashtable(6); result["GameId"] = srcObject.GameId; result["GameSetId"] = srcObject.GameSetId; result["RoomIsLobby"] = srcObject.RoomIsLobby; result["RoomName"] = srcObject.RoomName; result["RoomSFId"] = srcObject.RoomSFId; result["RoomUserCount"] = srcObject.RoomUserCount; return result; }
public static MNWSInfoRequestCurrGameRoomList.RequestResult MNWSInfoRequestCurrGameRoomListRequestResultFromDictionary(IDictionary deserializedObject) { if (deserializedObject == null) { return null; } MNWSInfoRequestCurrGameRoomList.RequestResult typedResult = new MNWSInfoRequestCurrGameRoomList.RequestResult(); List<object> deserializedItems = (List<object>)deserializedObject["DataEntry"]; MNWSRoomListItem[] items = null; if (deserializedItems != null) { items = new MNWSRoomListItem[deserializedItems.Count]; for (int index = 0;index < deserializedItems.Count;index++) { items[index] = MNWSRoomListItemFromDictionary((IDictionary)deserializedItems[index]); } } typedResult.DataEntry = items; typedResult.HadError = Convert.ToBoolean(deserializedObject["HadError"]); typedResult.ErrorMessage = (string)deserializedObject["ErrorMessage"]; return typedResult; }