Package beans.serializable

Examples of beans.serializable.EventBloc


        if (transporterOn) {
            destinationTransportOff = offScreen.getTransportDestination();
            destinationPointOff = offScreen.getTransportDestinationPoint();
        }

        final EventBloc event = new EventBloc(id, automatic, content, imagePath, cyclic, idToActivate);
        event.setOn(colisionOn, transporterOn, destinationTransportOn, destinationPointOn);
        event.setOff(colisionOff, transporterOff, destinationTransportOff, destinationPointOff);
        event.setPlayerPosition(playerPosition);

        editorModel.addEventResponse(position, event);
    }
View Full Code Here


        }
        final int x = (mouvementX == 0) ? 0 : ((mouvementX < 0) ? -1 : 1);
        final int y = (mouvementY == 0) ? 0 : ((mouvementY < 0) ? -1 : 1);
        final Point playerPosition = new Point(player.getAncientBloc().x + x, player.getAncientBloc().y + y);
        for (final Entry<Point, EventBloc> entry : colisionEvent.entrySet()) {
            final EventBloc eventBloc = entry.getValue();
            final boolean colision = (eventBloc.isColisionOff() && eventBloc.getCurrentMode() == EventBlocType.OFF) || (eventBloc.isColisionOn() && eventBloc.getCurrentMode() == EventBlocType.ON);
            final Point eventPosition = entry.getKey();
            if (colision && eventPosition.equals(playerPosition)) {
                return true;
            }
        }
View Full Code Here

    public void EnterRequest() {
        boolean nochange = true;
        final int tempX = (int) ((float) player.getX() / Float.parseFloat(String.valueOf(GeneralConstant.BLOC_WIDTH))) + 1;
        final int tempY = (int) ((float) player.getY() / Float.parseFloat(String.valueOf(GeneralConstant.BLOC_HEIGHT))) + 1;
        final Point playerPosition = new Point(tempX, tempY);
        final EventBloc event;
        final Point eventPosition;
        switch (player.getOrientation()) {
            case 0:
                eventPosition = new Point(tempX, tempY);
                event = manualEvent.get(new Point(tempX, tempY));
                break;
            case 1:
                eventPosition = new Point(tempX + 1, tempY);
                event = manualEvent.get(new Point(tempX + 1, tempY));
                break;
            case 2:
                eventPosition = new Point(tempX, tempY + 2);
                event = manualEvent.get(new Point(tempX, tempY + 2));
                break;
            case 3:
                eventPosition = new Point(tempX - 1, tempY);
                event = manualEvent.get(new Point(tempX - 1, tempY));
                break;
            default:
                eventPosition = null;
                event = null;
                break;
        }
        if (event != null && event.getCurrentMode() == EventBlocType.ON) {
            for (Objet objet : event.getContent()) {
                player.addObjet(objet, 1);
            }
            messageBuffer.addAll(MessagePropertie.getMessage("potion"));
            if (event.isColisionOff()) {
                addColision(eventPosition, GeneralConstant.BLOC_WIDTH, GeneralConstant.BLOC_HEIGHT);
            } else {
                removeColision(eventPosition, GeneralConstant.BLOC_WIDTH, GeneralConstant.BLOC_HEIGHT);
            }
            nochange = false;
            event.setCurrentMode(EventBlocType.OFF);
        } else if (event != null && event.getCurrentMode() == EventBlocType.OFF && event.isCyclique()) {
            if (event.isColisionOn()) {
                addColision(eventPosition, GeneralConstant.BLOC_WIDTH, GeneralConstant.BLOC_HEIGHT);
            } else {
                removeColision(eventPosition, GeneralConstant.BLOC_WIDTH, GeneralConstant.BLOC_HEIGHT);
            }
            event.setCurrentMode(EventBlocType.ON);
        }

        if (nochange) {
            if (!messageBuffer.isEmpty()) {
                messageBuffer.remove(0);
View Full Code Here

                 */
                if (eventBloc.getIdActive() != null) {
                    System.out.println("activation");
                    final String idAActiver = eventBloc.getIdActive();
                    for (final Entry<Point, EventBloc> entry : getConfig().getEvent().entrySet()) {
                        final EventBloc blocCourant = entry.getValue();
                        if (idAActiver.equals(blocCourant.getId())) {
                            executeEvent(blocCourant, entry.getKey());
                        }
                    }
                }
                switch (eventBloc.getCurrentMode()) {
View Full Code Here

TOP

Related Classes of beans.serializable.EventBloc

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.