本文整理汇总了C#中RoomData类的典型用法代码示例。如果您正苦于以下问题:C# RoomData类的具体用法?C# RoomData怎么用?C# RoomData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoomData类属于命名空间,在下文中一共展示了RoomData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:ltloibrights,项目名称:AsyncRPG,代码行数:60,代码来源:RoomData.cs
示例2: onUserLeftRoom
public void onUserLeftRoom(RoomData eventObj, String username)
{
if (Global.localUsername != username)
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
System.Diagnostics.Debug.WriteLine("someone left");
});
}
开发者ID:susheels,项目名称:Know-your-movie,代码行数:8,代码来源:NotificationListener.cs
示例3: Awake
void Awake()
{
Player = new PlayerData();
Room = new RoomData();
MessageQueue = new Queue<string>();
AfkChecker = gameObject.GetOrAddComponent<AFKChecker>();
AfkChecker.OnStatusChanged += OnAway;
}
开发者ID:Trainfire,项目名称:Drawesome,代码行数:8,代码来源:Connection.cs
示例4: Room
public Room(RoomData data)
{
RoomRect = data.RoomRect;
isMonsterHouse = data.IsMonsterHouse;
isShop = data.IsShop;
EntranceDoorPositions = new Vector2[] { };
ID = InstanceID++;
//Debug.Log(this.ToString());
}
开发者ID:sgmtjp,项目名称:Git-SODATERUTOWER,代码行数:9,代码来源:Room.cs
示例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");
});
}
开发者ID:AtulSBiet,项目名称:Tutorials_WP_7_8,代码行数:10,代码来源:NotificationListener.cs
示例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;
}
开发者ID:nikoudel,项目名称:SmartHome,代码行数:13,代码来源:CreateRoomController.cs
示例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);
}
开发者ID:hanahanaside,项目名称:Mansion,代码行数:11,代码来源:RoomDataDao.cs
示例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());
}
}
开发者ID:shephertz,项目名称:App42_AppWarp_Windows_Sample,代码行数:11,代码来源:NotificationListener.cs
示例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;
}
}
开发者ID:dmayfield,项目名称:Series-01-Action-Adventure,代码行数:12,代码来源:RoomManager.cs
示例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;
}
开发者ID:hanahanaside,项目名称:Mansion,代码行数:14,代码来源:RoomItemDialogController.cs
示例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 );
}
开发者ID:dmayfield,项目名称:Series-01-Action-Adventure,代码行数:14,代码来源:RoomManager.cs
示例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(); });
}
}
开发者ID:rahulpshephertz,项目名称:QuizUp-AppWarpS2,代码行数:16,代码来源:NotificationListener.cs
示例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 ();
}
开发者ID:hanahanaside,项目名称:Mansion,代码行数:16,代码来源:RoomController.cs
示例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);
}
开发者ID:z530989673,项目名称:MovieStudio,代码行数:16,代码来源:Cell.cs
示例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;
}
开发者ID:hanahanaside,项目名称:Mansion,代码行数:19,代码来源:RoomDataDao.cs
示例16: UpdateRoomQueue
void UpdateRoomQueue()
{
if( m_IsLoadingRoom == true )
{
return;
}
if( m_LoadRoomQueue.Count == 0 )
{
return;
}
m_CurrentLoadRoomData = m_LoadRoomQueue.Dequeue();
m_IsLoadingRoom = true;
//Debug.Log( "Loading new room: " + m_CurrentLoadRoomData.Name + " at " + m_CurrentLoadRoomData.X + ", " + m_CurrentLoadRoomData.Y );
StartCoroutine( LoadRoomRoutine( m_CurrentLoadRoomData ) );
}
开发者ID:dmayfield,项目名称:Series-01-Action-Adventure,代码行数:19,代码来源:RoomManager.cs
示例17: OnRecieveRoomList
void OnRecieveRoomList(ServerMessage.RoomList message)
{
browserItems.ForEach(x => Destroy(x.gameObject));
browserItems.Clear();
foreach (var room in message.Rooms)
{
// Make instance of view
var view = UiUtility.AddChild<UiBrowserItem>(Browser.gameObject, BrowserItemPrototype, true);
view.Text.text = string.Format("{0}'s Game / Players: {1} / Started?: {2}", room.Owner.Name, room.Players.Count, room.GameStarted);
view.Toggle.group = toggleGroup;
view.RoomData = room;
// Add toggle listener
var temp = room;
view.Toggle.onValueChanged.AddListener((enabled) =>
{
if (enabled)
{
Debug.LogFormat("Select room {0}", view.RoomData.ID);
selectedRoom = temp;
}
});
view.gameObject.GetOrAddComponent<DoubleClickHandler>().OnDoubleClick += () =>
{
OnJoin();
};
browserItems.Add(view);
}
// Select first item
if (browserItems.Count != 0)
browserItems[0].Toggle.isOn = true;
NoGames.SetActive(browserItems.Count == 0);
}
开发者ID:Trainfire,项目名称:Drawesome,代码行数:38,代码来源:UiBrowser.cs
示例18: onUserJoinedRoom
public void onUserJoinedRoom(RoomData eventObj, String username)
{
System.Diagnostics.Debug.WriteLine(username + " joined room");
/*
if(!username.Equals(Global.localUsername))
{
Global.opponentUsername = username;
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
_page.ready.Text = Global.localUsername + " \nvs\n" + Global.opponentUsername;
});
}
else if(!eventObj.getRoomOwner().Equals(Global.localUsername))
{
Global.opponentUsername = eventObj.getRoomOwner();
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
_page.ready.Text = Global.localUsername + " \nvs\n" + Global.opponentUsername;
});
}
*/
}
开发者ID:susheels,项目名称:Know-your-movie,代码行数:24,代码来源:NotificationListener.cs
示例19: method_11
public RoomData method_11(uint uint_0)
{
RoomData result;
if (this.method_12(uint_0) != null)
{
result = this.method_12(uint_0);
}
else
{
RoomData @class = new RoomData();
@class.FillNull(uint_0);
result = @class;
}
return result;
}
开发者ID:Waguiinhocvp,项目名称:Gold-Tree-Emulator,代码行数:15,代码来源:RoomManager.cs
示例20: onUserJoinedRoom
public void onUserJoinedRoom(RoomData eventObj, String username)
{
//_game_page.showResult(username + " joined " + eventObj.getId());
}
开发者ID:Katry4,项目名称:WinRepo,代码行数:4,代码来源:GameNotificationListener.cs
注:本文中的RoomData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论