Package match.api

Examples of match.api.Event


            throw new IllegalStateException(state.toString());

        AssignYellowCardEvent assignYellowCardEvent = new AssignYellowCardEvent(this.getPlayerModel());

        if (hasYellowCard(match)) {
            Event redCardEvent = assignRedCard(match);
            assignYellowCardEvent.setSucceedingEvent(redCardEvent);
            match.addAssignedRedCard(playerModel);
        }
        match.addAssignedYellowCard(playerModel);
View Full Code Here


        this.eventStore = eventStore;
        this.eventStore.store(match.getMatchId(), this.match.handle(new CreatedMatchEvent(match.getMatchId(), match.getPlayerSet())));
    }

    public void handle(Command command) {
        Event event = match.handle(command);
        storeEvents(event);
    }
View Full Code Here

        this.match = new Match(UUID.randomUUID(), createdMatchEvent.getPlayersMap());

        // Execute all arisen events.
        while (iterator.hasNext()) {
            Event next = iterator.next();
            next.execute(this.match);
        }
    }
View Full Code Here

    public void addAssignedRedCard(PlayerModel playerModel) {
        this.assignedRedCards.add(playerModel);
    }

    public Event handle(Command command) {
        Event event = command.execute(this);
        return handle(event);
    }
View Full Code Here

TOP

Related Classes of match.api.Event

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.