本文整理汇总了C#中RoomData类的典型用法代码示例。如果您正苦于以下问题:C# RoomData类的具体用法?C# RoomData怎么用?C# RoomData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoomData类属于命名空间,在下文中一共展示了RoomData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromObject
// Parsing
public static RoomData FromObject(JsonData jsonData)
{
RoomData roomData = new RoomData();
int gameID = SessionData.GetInstance().GameID;
int room_x = (int)jsonData["room_x"];
int room_y = (int)jsonData["room_y"];
int room_z = (int)jsonData["room_z"];
float world_x= jsonData["world_x"].IsInt ? (float)((int)jsonData["world_x"]) : (float)((double)jsonData["world_x"]);
float world_y= jsonData["world_y"].IsInt ? (float)((int)jsonData["world_y"]) : (float)((double)jsonData["world_y"]);
float world_z= jsonData["world_z"].IsInt ? (float)((int)jsonData["world_z"]) : (float)((double)jsonData["world_z"]);
roomData.RoomKey.Set(gameID, room_x, room_y, room_z);
roomData.WorldPosition.Set(world_x, world_y, world_z);
roomData.StaticRoomData = StaticRoomData.FromObject(roomData.RoomKey, jsonData["data"]);
{
JsonData portalList = jsonData["portals"];
for (int portalIndex= 0; portalIndex < portalList.Count; portalIndex++)
{
JsonData portalObject = portalList[portalIndex];
RoomPortal portal = RoomPortal.FromObject(portalObject);
roomData.RoomPortals.Add(portal);
}
}
{
JsonData mobObjects = jsonData["mobs"];
roomData.m_mobs = new Dictionary<int, MobData>();
for (int mobIndex= 0; mobIndex < mobObjects.Count; mobIndex++)
{
JsonData mobObject = mobObjects[mobIndex];
MobData mobData = MobData.FromObject(mobObject);
roomData.SetMobById(mobData.mob_id, mobData);
}
}
{
JsonData energyTankObjects = jsonData["energyTanks"];
roomData.m_energyTanks = new Dictionary<int, EnergyTankData>();
for (int energyTankIndex = 0; energyTankIndex < energyTankObjects.Count; energyTankIndex++)
{
JsonData energyTankObject = energyTankObjects[energyTankIndex];
EnergyTankData energyTankData = EnergyTankData.FromObject(energyTankObject);
roomData.SetEnergyTankById(energyTankData.energy_tank_id, energyTankData);
}
}
return roomData;
}
示例2: onUserLeftRoom
public void onUserLeftRoom(RoomData eventObj, String username)
{
if (Global.localUsername != username)
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
System.Diagnostics.Debug.WriteLine("someone left");
});
}
示例3: Awake
void Awake()
{
Player = new PlayerData();
Room = new RoomData();
MessageQueue = new Queue<string>();
AfkChecker = gameObject.GetOrAddComponent<AFKChecker>();
AfkChecker.OnStatusChanged += OnAway;
}
示例4: Room
public Room(RoomData data)
{
RoomRect = data.RoomRect;
isMonsterHouse = data.IsMonsterHouse;
isShop = data.IsShop;
EntranceDoorPositions = new Vector2[] { };
ID = InstanceID++;
//Debug.Log(this.ToString());
}
示例5: onUserJoinedRoom
public void onUserJoinedRoom(RoomData eventObj, String username)
{
_page.UpdateStatus(username + " joined " + eventObj.getId());
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
_page.UnLockGameboard();
_page.UpdateStatus("Click on any block to start Game");
});
}
示例6: Post
/// <summary>
/// Create and add a new Room into the repository.
/// </summary>
public RoomData Post(RoomData data)
{
// Note: repository creates a Room, not RoomData.
var room = Program.Rooms.Store(Room.createInstance(data.RoomType));
// set room ID back to the data object
data.Id = room.Id;
return data;
}
示例7: UpdateItemCount
public void UpdateItemCount (RoomData roomData) {
SQLiteDB sqliteDB = OpenDatabase ();
StringBuilder sb = new StringBuilder ();
sb.Append ("update " + ROOM_DATA_LIST_TABLE + " ");
sb.Append ("set " + RoomDataField.ITEM_COUNT + " = " + roomData.ItemCount + " ");
sb.Append ("where " + RoomDataField.ID + " = " + roomData.Id + ";");
Debug.Log("sql = "+sb.ToString());
SQLiteQuery sqliteQuery = new SQLiteQuery (sqliteDB, sb.ToString ());
sqliteQuery.Step ();
CloseDatabase (sqliteDB, sqliteQuery);
}
示例8: onUserChangeRoomProperty
public void onUserChangeRoomProperty(RoomData roomData, string sender, Dictionary<String, Object> properties)
{
_page.showResult("Notification for User Changed Room Propert received");
_page.showResult(roomData.getId());
_page.showResult(sender);
foreach (KeyValuePair<string, object> entry in properties)
{
_page.showResult("KEY:" + entry.Key);
_page.showResult("VALUE:" + entry.Value.ToString());
}
}
示例9: LoadRoomRoutine
IEnumerator LoadRoomRoutine( RoomData data )
{
string levelName = m_CurrentWorldName + data.Name;
AsyncOperation loadLevel = Application.LoadLevelAdditiveAsync( levelName );
while( loadLevel.isDone == false )
{
//Debug.Log( "Loading " + levelName + ": " + Mathf.Round( loadLevel.progress * 100 ) + "%" );
yield return null;
}
}
示例10: Init
void Init (RoomData roomData) {
Debug.Log ("roomId = " + roomData.Id);
mRoomData = roomData;
mShortMoneyTweenColor = priceLabelObject.GetComponent<TweenColor>();
string spriteName = "room_item_" + roomData.Id;
UISpriteData spriteData = roomItemAtlas.GetSprite (spriteName);
itemSprite.spriteName = "room_item_" + roomData.Id;
itemSprite.width = spriteData.width;
itemSprite.height = spriteData.height;
nameLabel.text = roomData.ItemName;
priceLabelObject.GetComponent<UILabel>().text = "price : " + roomData.ItemPrice;
countLabel.text = "所持数 : " + roomData.ItemCount;
descriptionLabel.text = roomData.ItemDescription;
}
示例11: LoadRoom
void LoadRoom( string name, int x, int y )
{
if( DoesRoomExist( x, y ) == true )
{
return;
}
RoomData newRoomData = new RoomData();
newRoomData.Name = name;
newRoomData.X = x;
newRoomData.Y = y;
m_LoadRoomQueue.Enqueue( newRoomData );
}
示例12: onUserJoinedRoom
public void onUserJoinedRoom(RoomData roomObj, String username)
{
Debug.WriteLine("On User Joined Room "+username);
if (!GlobalContext.joinedUsers.Contains(username))
{
GlobalContext.joinedUsers.Add(username);
}
if (!GlobalContext.localUsername.Equals(username))
{
GlobalContext.opponentName = username;
}
if((GlobalContext.joinedUsers.Count==2)&& GlobalContext.tableProperties["IsPrivateRoom"].Equals("true"))
{
Deployment.Current.Dispatcher.BeginInvoke(delegate() { App.g_HomePageListener.StartQuiz(); });
}
}
示例13: Init
void Init (RoomData roomData) {
mRoomData = roomData;
if(mItemSpriteList == null){
CreateItemSpriteList();
}
if (mRoomData.ItemCount == 0) {
lockObject.SetActive (true);
return;
}
// only first
UISprite firstItemSprite = mItemSpriteList[0];
if(!firstItemSprite.enabled){
SetActiveItem ();
}
SetTextData ();
}
示例14: ResetCell
public void ResetCell(RoomData roomData, Pair pos, int ord = 0)
{
room = roomData;
roomID = room.ID;
int roomLevel = GameManager.Instance.GetRoomLevel(roomID);
LevelItemData levelItemData = GameManager.Instance.GetLevelItemData(roomData.boardID);
if (levelItemData == null)
return;
int boardID = levelItemData.getItemID(roomLevel);
ItemData itemData = GameManager.Instance.GetItemData(boardID);
ResetItem(pos, itemData, ord, false);
}
示例15: GetRoomDataList
public List<RoomData> GetRoomDataList () {
SQLiteDB sqliteDB = OpenDatabase ();
string sql = "select * from " + ROOM_DATA_LIST_TABLE + ";";
Debug.Log("sql = "+ sql);
SQLiteQuery sqliteQuery = new SQLiteQuery (sqliteDB, sql);
List<RoomData> roomDataList = new List<RoomData> ();
while (sqliteQuery.Step()) {
RoomData roomData = new RoomData ();
roomData.Id = sqliteQuery.GetInteger (RoomDataField.ID);
roomData.ItemCount = sqliteQuery.GetInteger (RoomDataField.ITEM_COUNT);
roomData.ItemPrice = sqliteQuery.GetInteger (RoomDataField.PRICE);
roomData.GenerateSpeed = (float)sqliteQuery.GetDouble (RoomDataField.GENERATE_SPEED);
roomData.ItemName = sqliteQuery.GetString (RoomDataField.NAME);
roomData.ItemDescription = sqliteQuery.GetString (RoomDataField.DESCRIPTION);
roomDataList.Add (roomData);
}
CloseDatabase (sqliteDB, sqliteQuery);
return roomDataList;
}