final public void setTeamId ( int newId ) { if ( teamId != - 1 ) { throw new IllegalStateException ( "Team Id cannot be modified" ) ; } SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( new GamePermission ( "setTeamId" ) ) ; } teamId = newId ; }
Sets the team id . Can only be called once otherwise it will throw an exception