Package com.typesafe.akkademo.common

Examples of com.typesafe.akkademo.common.PlayerBet


    private void init() {
        try {
            Iterator<String> lines = Files.readLines(store, Charsets.UTF_8).iterator();
            while (lines.hasNext()) {
                PlayerBet playerBet = deserialize(lines.next());
                if (!bets.containsKey(playerBet.getId())) {
                    bets.put(playerBet.getId(), playerBet.getBet());
                }
            }
        } catch (IOException e) {
        }
    }
View Full Code Here


        return new ArrayList<Bet>(bets.values());
    }

    private PlayerBet deserialize(String line) {
        ImmutableList<String> pieces = ImmutableList.copyOf(splitter.split(line));
        return new PlayerBet(Integer.valueOf(pieces.get(0)), new Bet(pieces.get(1), Integer.valueOf(pieces.get(2)), Integer.valueOf(pieces.get(3))));
    }
View Full Code Here

TOP

Related Classes of com.typesafe.akkademo.common.PlayerBet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.