Example #1
0
        public OLobbyRoom CreateLobby(OPlayer host)
        {
            var maxLobId = (from lobMaxId in dc.Lobbies
                            select lobMaxId.LobbyId).Max();

            Lobby lobby = new Lobby();
            lobby.LobbyName = host.PlayerName + "'s lobby";
            lobby.LobbyId = ++maxLobId;
            lobby.IsWaitingForPlayers = true;
            lobby.IsUpdate = false;
            lobby.DiceRollllllllllllllllllllol = 0;

            PlayLobby pLobby = new PlayLobby();
            pLobby.HostPlayer = host.PlayerId;
            pLobby.LobbyId = lobby.LobbyId;
            pLobby.PlayerId = host.PlayerId;

            dc.PlayLobbies.InsertOnSubmit(pLobby);
            dc.Lobbies.InsertOnSubmit(lobby);
            dc.SubmitChanges();

            return new OLobbyRoom
                {
                    HostPlayer = host,
                    PlayerList = new List<OPlayer> { host },
                    TheLobby = new OLobby { LobbyId = lobby.LobbyId, LobbyName = lobby.LobbyName, IsUpdate = false }
                };
        }
Example #2
0
 partial void DeletePlayLobby(PlayLobby instance);
Example #3
0
 partial void UpdatePlayLobby(PlayLobby instance);
Example #4
0
 partial void InsertPlayLobby(PlayLobby instance);