Copying and Pasting cs Code

In cs, like in almost any computer programming language, reading data from a file can be tricky. You add extra lines of code to tell the computer what to do. Sometimes you can copy and paste these lines from other peoples’ code.

For example, you can follow the pattern in this listing:

     public bool OpCreateGame(string roomName, RoomOptions roomOptions, TypedLobby typedLobby)
     {
         bool onGameServer = this.server == ServerConnection.GameServer;
         if (!onGameServer)
         {
             this.mRoomOptionsForCreate = roomOptions;
             this.mRoomToGetInto = new Room(roomName, roomOptions);
             this.mRoomToEnterLobby = typedLobby ?? ((this.insideLobby) ? this.lobby : null); // use given lobby, or active lobby (if any active) or none
         }

         this.mLastJoinType = JoinType.CreateGame;
         return base.OpCreateRoom(roomName, roomOptions, this.mRoomToEnterLobby, this.GetLocalActorProperties(), onGameServer);
     }