Package Worms

## Class WormsPane

- java.lang.Object
- - javafx.scene.Node
  - - javafx.scene.Parent
    - - javafx.scene.layout.Region
      - - javafx.scene.layout.Pane
        - - Worms.WormsPane

- All Implemented Interfaces:
    `javafx.css.Styleable`, `javafx.event.EventTarget`

      class WormsPane
      extends javafx.scene.layout.Pane

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `private javafx.scene.image.Image` | `arrow` |
    `private javafx.scene.image.Image` | `baz` |
    `(package private) boolean` | `bazuka` | bazuka = urcuje ci je aktivna bazuka alebo granat
    `private javafx.scene.image.Image` | `bckgrnd` |
    `private java.util.List<Bullet>` | `bullets` |
    `(package private) int` | `counter` | counter = pocita timer
    `private java.util.List<Grenade>` | `grenades` |
    `private javafx.scene.image.Image` | `grnd` |
    `private int` | `h` |
    `(package private) int` | `id` | id = ktora mapka je zvolena
    `private javafx.scene.image.Image` | `imgLeft` |
    `private javafx.scene.image.Image` | `imgRight` |
    `(package private) javafx.scene.paint.Color` | `koniec` | koniec = urcuje ktory tym vyhral
    `private javafx.scene.image.Image` | `map1` |
    `private javafx.scene.image.Image` | `map2` |
    `private javafx.scene.image.Image` | `map3` |
    `private javafx.scene.image.Image` | `map4` |
    `private javafx.scene.image.ImageView` | `mapa` |
    `(package private) int` | `maxhp` | maxhp = kolko maxhp budu mat wormsovia
    `private double` | `mx` |
    `private double` | `my` |
    `private boolean` | `preparedMap` |
    `private javafx.scene.image.Image` | `radiusB` |
    `private javafx.scene.image.Image` | `radiusG` |
    `private java.util.Random` | `rnd` |
    `private javafx.scene.image.Image` | `sea` |
    `(package private) int` | `seaLevel` | urcuje vysku mora
    `private javafx.scene.image.ImageView` | `seaView` |
    `(package private) javafx.scene.paint.Color` | `tah` | tah = farba tymu ktory je na tahu
    `private int` | `teamsize` |
    `private javafx.scene.image.Image` | `tomb` |
    `private int` | `w` |
    `private javafx.scene.image.WritableImage` | `wi` |
    `private Worm` | `wormG` |
    `private java.util.List<Worm>` | `WormG` |
    `private Worm` | `wormR` |
    `private java.util.List<Worm>` | `WormR` |
    `private int` | `WormSize` |
    `(package private) boolean` | `zac` | zac = urcuje ci je skonecna faza ukladania wormsov
    `private javafx.scene.image.ImageView` | `zbran` |

    - ### Fields inherited from class javafx.scene.layout.Region

      `USE_COMPUTED_SIZE, USE_PREF_SIZE`

    - ### Fields inherited from class javafx.scene.Node

      `BASELINE_OFFSET_SAME_AS_HEIGHT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WormsPane​(int id, int hp, int teamsize)` | Konstruktor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addBullet​(double xx, double yy, double mx, double my)` | Metoda vytvara novy projektil a uklada ho do listu nabojov ktore su momentalne na mape
    `void` | `addGrenade​(double xx, double yy, double mx, double my)` | Metoda vytvara novy granat a uklada ho do listu granatov ktore su momentalne na mape
    `void` | `addWorm​(double mx, double my, javafx.scene.paint.Color farba)` | Metoda vytvori noveho wormsa s hodnotami argumentov,nastavi ho do triednej premmenej.
    `void` | `changePlayer()` | Meni ktory worm je na rade,zdviha hladinu mora
    `void` | `checkDeaths()` | Metoda kontroluje ci su wormsovia nazive
    `void` | `destroy​(int x, int y, boolean b)` | Riesi vykreslenie kolizie terenu a naboja,"odkusuje" kusky mapy podla polohy kolizie a typu zbrane
    `void` | `end​(javafx.scene.paint.Color win)` | Metoda je zavolana na konci hry,vynuluje premenne ktore su pouzivane pri hre,vypise vyhercu oznamuje kto vyhral
    `void` | `gui()` | Vykresluje timer,zbran,ammo,trigger,nataca wormsov za kurzorom
    `void` | `nextText()` | Vykresluje text ktory hovori kto je dalsi na tahu
    `protected void` | `paintBallPane()` | Hlavne metoda programu ktora riesi ci skoncila hra,ci je nastavena mapka,ci su nastaveny wormsovia,nakoniec spusta metody gui a updateWorm.
    `void` | `paintBullet()` | Vykresluje vsetky aktivne projektily a riesi kolizie
    `void` | `paintGrenade()` | Vykresluje vsetky aktivne granaty a riesi kolizie
    `void` | `paintWorm()` | Metoda vykresluje Wormsa a jeho zivot,natocenie za myskou,smrt.
    `void` | `positionWorms()` | Metoda je volana pri zaciatku hry, poklada wormsov na miesto kde hrac klikne (vola addWorm).
    `void` | `prepareMap()` | Vykresluje zvolenu mapku pred prvym zobrazenim
    `Worm` | `rndWorm​(javafx.scene.paint.Color farba)` | Vybere ktory cervik z tymu bude nasledovat ako dalsi na rade
    `void` | `timer()` | Spravuje timer
    `void` | `updateWorm()` | Metoda kontroluje ktory hrac je na tahu a ktora zbran je zvolena, poÄŹla toho vola a predava argumenty metodam AddBullet,AddGrenade.

    - ### Methods inherited from class javafx.scene.layout.Pane

      `getChildren`

    - ### Methods inherited from class javafx.scene.layout.Region

      `backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty`

    - ### Methods inherited from class javafx.scene.Parent

      `getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds`

    - ### Methods inherited from class javafx.scene.Node

      `accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface javafx.css.Styleable

      `getStyleableNode`

- - ### Field Detail

    - #### bckgrnd

          private final javafx.scene.image.Image bckgrnd

    - #### imgRight

          private final javafx.scene.image.Image imgRight

    - #### imgLeft

          private final javafx.scene.image.Image imgLeft

    - #### grnd

          private final javafx.scene.image.Image grnd

    - #### baz

          private final javafx.scene.image.Image baz

    - #### map1

          private final javafx.scene.image.Image map1

    - #### map2

          private final javafx.scene.image.Image map2

    - #### map3

          private final javafx.scene.image.Image map3

    - #### map4

          private final javafx.scene.image.Image map4

    - #### radiusB

          private final javafx.scene.image.Image radiusB

    - #### radiusG

          private final javafx.scene.image.Image radiusG

    - #### sea

          private final javafx.scene.image.Image sea

    - #### tomb

          private final javafx.scene.image.Image tomb

    - #### arrow

          private final javafx.scene.image.Image arrow

    - #### rnd

          private java.util.Random rnd

    - #### wi

          private javafx.scene.image.WritableImage wi

    - #### mx

          private double mx

    - #### my

          private double my

    - #### WormSize

          private final int WormSize

      See Also:
        Constant Field Values

    - #### w

          private final int w

      See Also:
        Constant Field Values

    - #### h

          private final int h

      See Also:
        Constant Field Values

    - #### mapa

          private javafx.scene.image.ImageView mapa

    - #### zbran

          private javafx.scene.image.ImageView zbran

    - #### seaView

          private javafx.scene.image.ImageView seaView

    - #### bullets

          private java.util.List<Bullet> bullets

    - #### grenades

          private java.util.List<Grenade> grenades

    - #### WormG

          private java.util.List<Worm> WormG

    - #### WormR

          private java.util.List<Worm> WormR

    - #### wormR

          private Worm wormR

    - #### wormG

          private Worm wormG

    - #### preparedMap

          private boolean preparedMap

    - #### teamsize

          private int teamsize

    - #### tah

          javafx.scene.paint.Color tah

      tah = farba tymu ktory je na tahu

    - #### maxhp

          int maxhp

      maxhp = kolko maxhp budu mat wormsovia

    - #### seaLevel

          int seaLevel

      urcuje vysku mora

    - #### zac

          boolean zac

      zac = urcuje ci je skonecna faza ukladania wormsov

    - #### bazuka

          boolean bazuka

      bazuka = urcuje ci je aktivna bazuka alebo granat

    - #### koniec

          javafx.scene.paint.Color koniec

      koniec = urcuje ktory tym vyhral

    - #### counter

          int counter

      counter = pocita timer

    - #### id

          int id

      id = ktora mapka je zvolena

  - ### Constructor Detail

    - #### WormsPane

          public WormsPane​(int id,
                           int hp,
                           int teamsize)

      Konstruktor
      Parameters:
        `id` - udava ktora z mapiek je vybrata
        `hp` - udava kolko je nastavenych hp
        `teamsize` - udava kolko wormsov bude v teame

  - ### Method Detail

    - #### paintBallPane

          protected void paintBallPane()

      Hlavne metoda programu ktora riesi ci skoncila hra,ci je nastavena mapka,ci su nastaveny wormsovia,nakoniec spusta metody gui a updateWorm.

    - #### updateWorm

          public void updateWorm()

      Metoda kontroluje ktory hrac je na tahu a ktora zbran je zvolena, poÄŹla toho vola a predava argumenty metodam AddBullet,AddGrenade.

    - #### rndWorm

          public Worm rndWorm​(javafx.scene.paint.Color farba)

      Vybere ktory cervik z tymu bude nasledovat ako dalsi na rade
      Parameters:
        `farba` - urcuje ktoremu tymu urcujeme wormsa
      Returns:
        vrati jedneho nahodneho cervika farby z argumentu

    - #### positionWorms

          public void positionWorms()

      Metoda je volana pri zaciatku hry, poklada wormsov na miesto kde hrac klikne (vola addWorm).

    - #### addWorm

          public void addWorm​(double mx,
                              double my,
                              javafx.scene.paint.Color farba)

      Metoda vytvori noveho wormsa s hodnotami argumentov,nastavi ho do triednej premmenej.
      Parameters:
        `mx` - x-ova pozicia wormsa(mysky)
        `my` - y-ova pozicia wormsa(mysky)
        `farba` - farba hraca ktory bol na tahu ked bola zavolana metoda

    - #### paintWorm

          public void paintWorm()

      Metoda vykresluje Wormsa a jeho zivot,natocenie za myskou,smrt. Ak je Worms vo vzduchu znizuje jeho vysku kym nenarazi na zem

    - #### addBullet

          public void addBullet​(double xx,
                                double yy,
                                double mx,
                                double my)

      Metoda vytvara novy projektil a uklada ho do listu nabojov ktore su momentalne na mape
      Parameters:
        `xx` - x-ova suradnica stredu wormsa
        `yy` - y-ova suradnica stredu wormsa
        `mx` - x-ova suradnica mysi
        `my` - y-ova suradnica mysi

    - #### paintBullet

          public void paintBullet()

      Vykresluje vsetky aktivne projektily a riesi kolizie

    - #### addGrenade

          public void addGrenade​(double xx,
                                 double yy,
                                 double mx,
                                 double my)

      Metoda vytvara novy granat a uklada ho do listu granatov ktore su momentalne na mape
      Parameters:
        `xx` - x-ova suradnica stredu wormsa
        `yy` - y-ova suradnica stredu wormsa
        `mx` - x-ova suradnica mysi
        `my` - y-ova suradnica mysi

    - #### paintGrenade

          public void paintGrenade()

      Vykresluje vsetky aktivne granaty a riesi kolizie

    - #### prepareMap

          public void prepareMap()

      Vykresluje zvolenu mapku pred prvym zobrazenim

    - #### gui

          public void gui()

      Vykresluje timer,zbran,ammo,trigger,nataca wormsov za kurzorom

    - #### nextText

          public void nextText()

      Vykresluje text ktory hovori kto je dalsi na tahu

    - #### destroy

          public void destroy​(int x,
                              int y,
                              boolean b)

      Riesi vykreslenie kolizie terenu a naboja,"odkusuje" kusky mapy podla polohy kolizie a typu zbrane
      Parameters:
        `x` - x-ova pozicia pixelu mapy kde nastala kolizia
        `y` - y-ova pozicia pixelu mapy kde nastala kolizia
        `b` - urcuje ktora zbran bola pouzita pri kolizii

    - #### end

          public void end​(javafx.scene.paint.Color win)

      Metoda je zavolana na konci hry,vynuluje premenne ktore su pouzivane pri hre,vypise vyhercu oznamuje kto vyhral
      Parameters:
        `win` - urcuje kto vyhral hru

    - #### checkDeaths

          public void checkDeaths()

      Metoda kontroluje ci su wormsovia nazive

    - #### timer

          public void timer()

      Spravuje timer

    - #### changePlayer

          public void changePlayer()

      Meni ktory worm je na rade,zdviha hladinu mora