Package com.threerings.parlor.tourney.data

Examples of com.threerings.parlor.tourney.data.Participant


        if (_trobj.state != TourneyObject.PENDING) {
            throw new InvocationException(TOO_LATE);
        }

        // make sure they haven't already signed up
        final Participant part = makeParticipant(body);
        if (_trobj.participants.contains(part)) {
            throw new InvocationException(ALREADY_IN_TOURNEY);
        }

        // allow the implementing class to do further join checks
        joinTourney(body);

        // check the entrance fee
        if (_trobj.config.entryFee != null) {
            if (!_trobj.config.entryFee.hasFee(body)) {
                listener.requestFailed("FAILED_ENTRY_FEE");
                return;
            }

            // make the assumption that they're going to get in
            _trobj.addToParticipants(part);

            ResultListener<Void> rl = new ResultListener<Void>() {
                public void requestCompleted (Void result) {
                    listener.requestProcessed();
                }
                public void requestFailed (Exception cause) {
                    // remove them from the tourney
                    _trobj.removeFromParticipants(part.getKey());
                    listener.requestFailed("FAILED_ENTRY_FEE");
                }
            };

            _trobj.config.entryFee.reserveFee(body, rl);
View Full Code Here


    }

    /** Creates a {@link Participant} record for the specified user. */
    protected Participant makeParticipant (BodyObject body)
    {
        Participant part = new Participant();
        part.username = body.username;
        return part;
    }
View Full Code Here

TOP

Related Classes of com.threerings.parlor.tourney.data.Participant

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.