namespace Models { export class RoomChannel extends Models . Channel { description : string ; games : number [ ] = [ ] ; private : boolean ; tournamentOnly : boolean ; globalGamesOnly : boolean ; constructor ( channelId ) { super ( channelId , ChannelType . Room ) ; } public mergeRoomName ( room ) { let touch = false ; if ( this . name != room . name ) { this . name = room . name ; touch = true ; } if ( this . private != room . private ) { this . private = room . private ; touch = true ; } if ( this . tournamentOnly != room . tournOnly ) { this . tournamentOnly = room . tournOnly ; touch = true ; } if ( this . globalGamesOnly != room . globalGamesOnly ) { this . globalGamesOnly = room . globalGamesOnly ; touch = true ; } return touch ; } public mergeRoomDescription ( description ) { if ( this . description != description ) { this . description = description ; return true ; } else return false ; } public addGame ( gameChannelId ) { return Utils . setAdd ( this . games , gameChannelId ) ; } public removeGame ( gameChannelId ) { return Utils . setRemove ( this . games , gameChannelId ) ; } } }