package com.kduda.battleships.models.units;

import javafx.geometry.Orientation;

public enum UnitFactory {
    INSTANCE;

    Unit createUnit(UnitType type, int size, Orientation orientation) {
        switch (type) {
            case Ship:
                return new Ship(size, orientation);
            case Tank:
                break;
            case Plane:
                break;
        }
        return null;
    }


}

@@ -131,16 +131,26 @@
 t create
+GrounLevel
 Unit(Uni
@@ -340,38 +340,43 @@
     
-b
 re
-ak;%0A            case Plane:
+turn new Tank(size, orientation);
 %0A   
@@ -380,24 +380,26 @@
         
+%7D%0A
         
 break;%0A 
@@ -394,52 +394,131 @@
     
-b
 re
-ak
+turn null
 ;%0A    
+%7D%0A%0A
     
-%7D%0A        return null
+Unit createPlane(int size, Direction direction) %7B%0A        return new Plane(size, direction)
 ;%0A    %7D%0A
 %0A%0A%7D%0A
@@ -513,12 +513,10 @@
 ;%0A    %7D%0A
-%0A%0A
 %7D%0A

Add UnitFactory implementation