@Override public String getName() { return options.getName(); }
public TableController(UUID roomId, UUID userId, MatchOptions options) { this.userId = userId; this.options = options; match = GameFactory.instance.createMatch(options.getGameType(), options); if (userId != null) { Optional<User> user = UserManager.instance.getUser(userId); // TODO: Handle if user == null controllerName = user.map(User::getName).orElse("undefined"); } else { controllerName = "System"; } table = new Table(roomId, options.getGameType(), options.getName(), controllerName, DeckValidatorFactory.instance.createDeckValidator(options.getDeckType()), options.getPlayerTypes(), TableRecorderImpl.instance, match, options.getBannedUsers(), options.isPlaneChase()); chatId = ChatManager.instance.createChatSession("Match Table " + table.getId()); init(); }
versionStr = "2"; PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NAME + versionStr, options.getName()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_PASSWORD + versionStr, options.getPassword()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_DECK_TYPE + versionStr, options.getDeckType());
public ResultProtos.MatchOptionsProto toProto() { ResultProtos.MatchOptionsProto.Builder builder = ResultProtos.MatchOptionsProto.newBuilder() .setName(this.getName()) .setLimited(this.isLimited()) .setRated(this.isRated()) .setWinsNeeded(this.getWinsNeeded()); ResultProtos.SkillLevel skillLevel = ResultProtos.SkillLevel.BEGINNER; switch (this.getSkillLevel()) { case BEGINNER: skillLevel = ResultProtos.SkillLevel.BEGINNER; break; case CASUAL: skillLevel = ResultProtos.SkillLevel.CASUAL; break; case SERIOUS: skillLevel = ResultProtos.SkillLevel.SERIOUS; break; } builder.setSkillLevel(skillLevel); return builder.build(); } }