9 Commits
Author SHA1 Message Date
Ramtin Jafari 85c71fdf0b adding diagrams 2026-07-08 10:24:04 +03:30
Ramtin Jafari 8eeeb10b5d enhance extensibility 2026-07-07 18:31:36 +03:30
Ramtin Jafari 2de96ca23d add Entity 2026-07-07 18:30:50 +03:30
Ramtin Jafari 7f41ccf7b5 add item classes 2026-07-07 18:11:38 +03:30
Ramtin Jafari 43ee0c1562 apply the item hierarchy 2026-07-07 17:52:30 +03:30
Ramtin Jafari 3b060c446c add EntityState 2026-07-07 17:33:52 +03:30
Ramtin Jafari 9795b47ce4 add attack power ups for the game 2026-07-07 17:33:40 +03:30
Ramtin Jafari d880c5c616 Add interfaces 2026-07-07 17:15:42 +03:30
Ramtin Jafari 01cef05115 removing unnecessary files 2026-07-07 15:30:24 +03:30
30 changed files with 814 additions and 150 deletions
+387
View File
@@ -0,0 +1,387 @@
<mxfile host="app.diagrams.net">
<diagram name="Page-1" id="S8xx0SNJsf2MUWKB9l3i">
<mxGraphModel dx="2732" dy="1763" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" background="light-dark(#ffffff, #000000)" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-25" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Item&lt;div&gt;&quot;abstract&quot;&lt;/div&gt;" vertex="1">
<mxGeometry height="126" width="160" x="-130" y="518.75" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-26" parent="Kkar4GxZ3Pt5WynWM7sy-25" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="- Name : string" vertex="1">
<mxGeometry height="26" width="160" y="40" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-205" parent="Kkar4GxZ3Pt5WynWM7sy-25" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ Owner : Entity" vertex="1">
<mxGeometry height="26" width="160" y="66" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-27" parent="Kkar4GxZ3Pt5WynWM7sy-25" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="160" y="92" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-28" parent="Kkar4GxZ3Pt5WynWM7sy-25" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ GetName() : String" vertex="1">
<mxGeometry height="26" width="160" y="100" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-29" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="SellableItem" vertex="1">
<mxGeometry height="90" width="160" x="-280" y="720" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-30" parent="Kkar4GxZ3Pt5WynWM7sy-29" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="- Price : int" vertex="1">
<mxGeometry height="26" width="160" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-31" parent="Kkar4GxZ3Pt5WynWM7sy-29" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="160" y="56" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-32" parent="Kkar4GxZ3Pt5WynWM7sy-29" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ GetPrice() : int" vertex="1">
<mxGeometry height="26" width="160" y="64" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-34" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=56;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="KeyItem" vertex="1">
<mxGeometry height="30" width="160" x="20" y="720" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-38" parent="1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;IAttachable&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&quot;Interface&quot;&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ AttachTo(entity: Entity): Void&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ DeAttachFrom(entity: Entity): void&lt;/p&gt;" vertex="1">
<mxGeometry height="85" width="220" x="-660" y="650" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-46" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;" target="Kkar4GxZ3Pt5WynWM7sy-43">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-39" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Accessory&lt;div&gt;&quot;abstract&quot;&lt;/div&gt;" vertex="1">
<mxGeometry height="100" width="160" x="-480" y="880" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-40" parent="Kkar4GxZ3Pt5WynWM7sy-39" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="- Health : int" vertex="1">
<mxGeometry height="26" width="160" y="40" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-41" parent="Kkar4GxZ3Pt5WynWM7sy-39" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="160" y="66" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-42" parent="Kkar4GxZ3Pt5WynWM7sy-39" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ GetHealth() : int" vertex="1">
<mxGeometry height="26" width="160" y="74" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-43" parent="1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;spacingTop=0;spacingBottom=0;" value="&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;IDamageable&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&quot;Interface&quot;&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ TakeDamage(int amount) : void&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ HandleZeroHealth() : void&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ IsDestroyed() : boolean&lt;/p&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="120" width="320" x="-490" y="480" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-45" parent="1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;spacingTop=0;spacingBottom=0;" value="&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;p style=&quot;margin: 4px 0px 0px; text-align: center;&quot;&gt;&lt;b&gt;IDamager&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin: 4px 0px 0px; text-align: center;&quot;&gt;&lt;i&gt;&quot;Interface&quot;&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style: solid;&quot;&gt;&lt;p style=&quot;margin: 0px 0px 0px 4px;&quot;&gt;+ Damage(target: IDamageable) : void&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 0px 4px;&quot;&gt;+ GetUtils() : IDamager[]&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 0px 4px;&quot;&gt;+ GetDamage() : int&lt;/p&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="115" width="330" x="-1220" y="515" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-49" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.496;entryY=0.974;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;entryPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-28">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-95" y="800" as="sourcePoint" />
<mxPoint x="-5" y="620" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-50" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-34" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.493;entryY=1.001;entryDx=0;entryDy=0;entryPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-28">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-10" y="841" as="sourcePoint" />
<mxPoint x="-50" y="650" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-52" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.492;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;entryPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-32">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-250" y="941" as="sourcePoint" />
<mxPoint x="-101" y="870" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-53" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Weapon" vertex="1">
<mxGeometry height="56" width="160" x="-670" y="1030" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-54" parent="Kkar4GxZ3Pt5WynWM7sy-53" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="&lt;div&gt;- Damage : int&lt;/div&gt;" vertex="1">
<mxGeometry height="26" width="160" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-61" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Shield" vertex="1">
<mxGeometry height="56" width="160" x="-270" y="1030" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-62" parent="Kkar4GxZ3Pt5WynWM7sy-61" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="&lt;div&gt;- Defense : int&lt;/div&gt;" vertex="1">
<mxGeometry height="26" width="160" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-65" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Costum" vertex="1">
<mxGeometry height="56" width="160" x="-480" y="1030" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-66" parent="Kkar4GxZ3Pt5WynWM7sy-65" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="&lt;div&gt;- Defense : int&lt;/div&gt;" vertex="1">
<mxGeometry height="26" width="160" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-69" parent="1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;spacingTop=0;spacingBottom=0;" value="&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;IDefender&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&quot;Interface&quot;&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ Apply(int damage) : int&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ GetDefense() : int&lt;/p&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="100" width="190" x="-80" y="900" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-70" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-65" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;" target="Kkar4GxZ3Pt5WynWM7sy-69">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-300" y="1053" />
<mxPoint x="-300" y="1020" />
<mxPoint x="15" y="1020" />
</Array>
<mxPoint x="-240" y="1250" as="sourcePoint" />
<mxPoint x="-155" y="990" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-71" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-61" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-69">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="15" y="1053" />
</Array>
<mxPoint x="150" y="920" as="sourcePoint" />
<mxPoint x="20" y="1000" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-72" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-53" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.477;entryY=1.035;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;entryPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-42">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-530" y="933" as="sourcePoint" />
<mxPoint x="-411" y="840" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-73" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-61" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.48;entryY=1.035;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;entryPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-42">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-260" y="973" as="sourcePoint" />
<mxPoint x="-141" y="880" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-74" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-65" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.477;entryY=1.035;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;entryPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-42">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-280" y="970" as="sourcePoint" />
<mxPoint x="-161" y="877" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-76" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-105" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;endSize=18;startSize=18;startArrow=diamondThin;startFill=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-205">
<mxGeometry relative="1" as="geometry">
<mxPoint x="150" y="290" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-85" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-96" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;exitX=0;exitY=0;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-43">
<mxGeometry relative="1" as="geometry">
<mxPoint x="260" y="130" as="sourcePoint" />
<mxPoint x="-210" y="220" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-86" parent="1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;spacingTop=0;spacingBottom=0;" value="&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;IHealable&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&quot;Interface&quot;&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ Heal(int amount) : void&lt;/p&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="82.5" width="320" x="-840" y="518.75" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-87" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-96" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;exitX=0;exitY=0;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-86">
<mxGeometry relative="1" as="geometry">
<mxPoint x="240" y="170" as="sourcePoint" />
<mxPoint x="-320" y="510" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-96" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Entity&lt;/span&gt;&lt;div style=&quot;font-weight: 400;&quot;&gt;&quot;abstract&quot;&lt;/div&gt;" vertex="1">
<mxGeometry height="528" width="280" x="220" y="340" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-100" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ MaxHealth : int" vertex="1">
<mxGeometry height="30" width="280" y="40" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-208" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Health : int" vertex="1">
<mxGeometry height="30" width="280" y="70" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-109" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Costum : Custom" vertex="1">
<mxGeometry height="30" width="280" y="100" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-108" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Weapon : Weapon" vertex="1">
<mxGeometry height="30" width="280" y="130" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-107" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Shield : Sheild" vertex="1">
<mxGeometry height="30" width="280" y="160" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-106" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Money : long" vertex="1">
<mxGeometry height="30" width="280" y="190" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-105" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Inverntory : ArrayList&amp;lt;Item&amp;gt;" vertex="1">
<mxGeometry height="30" width="280" y="220" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-104" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ State : EntityState" vertex="1">
<mxGeometry height="30" width="280" y="250" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-103" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ BaseDamage : int" vertex="1">
<mxGeometry height="30" width="280" y="280" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-98" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="280" y="310" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-112" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ ModifyMoney(amount: long, dir: boolean) : void" vertex="1">
<mxGeometry height="30" width="280" y="318" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-113" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ GetInventory() : Item[]" vertex="1">
<mxGeometry height="30" width="280" y="348" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-118" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ GetInventoryByClass(class: ItemClass) : Item[]" vertex="1">
<mxGeometry height="30" width="280" y="378" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-115" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ sellItem(item: Item) : void" vertex="1">
<mxGeometry height="30" width="280" y="408" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-116" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ SellUnnecesarry() : void" vertex="1">
<mxGeometry height="30" width="280" y="438" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-117" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ SellSellable() : void" vertex="1">
<mxGeometry height="30" width="280" y="468" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-119" parent="Kkar4GxZ3Pt5WynWM7sy-96" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ AddToInventory(item: Item) : void" vertex="1">
<mxGeometry height="30" width="280" y="498" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-120" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Player&lt;/span&gt;&lt;br&gt;&lt;div style=&quot;font-weight: 400;&quot;&gt;&quot;abstract&quot;&lt;/div&gt;" vertex="1">
<mxGeometry height="408" width="270" x="-165" y="-120" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-129" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ MaxStamina : int" vertex="1">
<mxGeometry height="30" width="270" y="40" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-130" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Stamina : int" vertex="1">
<mxGeometry height="30" width="270" y="70" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-141" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="&lt;div&gt;+ Level : int&lt;/div&gt;" vertex="1">
<mxGeometry height="30" width="270" y="100" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-142" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="&lt;div&gt;+ CurLevelProcess: int&lt;/div&gt;" vertex="1">
<mxGeometry height="30" width="270" y="130" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-131" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="160" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-132" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ AddLevelProcess(int amount) : void" vertex="1">
<mxGeometry height="30" width="270" y="168" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-133" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ UpgradeLevel() : void" vertex="1">
<mxGeometry height="30" width="270" y="198" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-145" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ lightAttack() : void" vertex="1">
<mxGeometry height="30" width="270" y="228" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-146" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ heavyAttack() : void" vertex="1">
<mxGeometry height="30" width="270" y="258" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-147" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ defend() : void" vertex="1">
<mxGeometry height="30" width="270" y="288" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-148" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ heal() : void" vertex="1">
<mxGeometry height="30" width="270" y="318" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-114" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ ModifyStamina(amount: int, dir: boolean) : void" vertex="1">
<mxGeometry height="30" width="270" y="348" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-149" parent="Kkar4GxZ3Pt5WynWM7sy-120" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ abstract specialAbility() : void" vertex="1">
<mxGeometry height="30" width="270" y="378" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-143" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-120" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.996;exitY=0.039;exitDx=0;exitDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-96">
<mxGeometry relative="1" as="geometry">
<mxPoint x="490" y="120" as="sourcePoint" />
<mxPoint x="340" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-144" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-120" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;exitX=0.025;exitY=0.054;exitDx=0;exitDy=0;exitPerimeter=0;" target="Kkar4GxZ3Pt5WynWM7sy-45">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-370" y="40" as="sourcePoint" />
<mxPoint x="-530" y="349" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-152" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Enemy&lt;/span&gt;&lt;br&gt;&lt;div style=&quot;font-weight: 400;&quot;&gt;&quot;abstract&quot;&lt;/div&gt;" vertex="1">
<mxGeometry height="138" width="270" x="505" y="-100" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-167" parent="Kkar4GxZ3Pt5WynWM7sy-152" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ Key: KeyItem" vertex="1">
<mxGeometry height="30" width="270" y="40" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-157" parent="Kkar4GxZ3Pt5WynWM7sy-152" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="70" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-158" parent="Kkar4GxZ3Pt5WynWM7sy-152" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ DropLoot(player: Player) : void" vertex="1">
<mxGeometry height="30" width="270" y="78" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-184" parent="Kkar4GxZ3Pt5WynWM7sy-152" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;container=0;" value="+ abstract AttackPlayer(player: Player) : void" vertex="1">
<mxGeometry height="30" width="270" y="108" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-165" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-152" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.25;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-96">
<mxGeometry relative="1" as="geometry">
<mxPoint x="510" y="-150" as="sourcePoint" />
<mxPoint x="466" y="585" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-168" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Dragon&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="295" y="-310" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-170" parent="Kkar4GxZ3Pt5WynWM7sy-168" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-180" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Goblin&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="695" y="-310" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-182" parent="Kkar4GxZ3Pt5WynWM7sy-180" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-185" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Skeleton&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="295" y="-220" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-186" parent="Kkar4GxZ3Pt5WynWM7sy-185" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-187" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Vampire&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="695" y="-220" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-188" parent="Kkar4GxZ3Pt5WynWM7sy-187" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-190" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-185" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-152">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1140" y="-20" as="sourcePoint" />
<mxPoint x="995" y="495" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-193" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-168" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-152">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1005" y="-10" as="sourcePoint" />
<mxPoint x="1080" y="91" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-194" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-187" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-152">
<mxGeometry relative="1" as="geometry">
<mxPoint x="975" y="20" as="sourcePoint" />
<mxPoint x="1050" y="211" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-195" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-180" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-152">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1010" y="-10" as="sourcePoint" />
<mxPoint x="955" y="91" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-196" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Wisard&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="-330" y="-220" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-197" parent="Kkar4GxZ3Pt5WynWM7sy-196" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-198" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Assasin&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="-165" y="-340" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-199" parent="Kkar4GxZ3Pt5WynWM7sy-198" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-200" parent="1" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="&lt;span style=&quot;font-weight: 400;&quot;&gt;Knight&lt;/span&gt;" vertex="1">
<mxGeometry height="38" width="270" x="5" y="-220" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-201" parent="Kkar4GxZ3Pt5WynWM7sy-200" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" value="" vertex="1">
<mxGeometry height="8" width="270" y="30" as="geometry" />
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-202" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-200" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-120">
<mxGeometry relative="1" as="geometry">
<mxPoint x="290" y="-410" as="sourcePoint" />
<mxPoint x="235" y="-219" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-203" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-196" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-120">
<mxGeometry relative="1" as="geometry">
<mxPoint x="200" y="-360" as="sourcePoint" />
<mxPoint x="165" y="-249" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-204" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-198" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=0;startSize=16;endSize=15;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-120">
<mxGeometry relative="1" as="geometry">
<mxPoint x="165" y="-410" as="sourcePoint" />
<mxPoint x="195" y="-299" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-206" edge="1" parent="1" source="Kkar4GxZ3Pt5WynWM7sy-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=0;startSize=16;endSize=15;dashed=1;dashPattern=8 8;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" target="Kkar4GxZ3Pt5WynWM7sy-38">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-400" y="820" />
<mxPoint x="-550" y="820" />
</Array>
<mxPoint x="-390" y="1190" as="sourcePoint" />
<mxPoint x="-169" y="1380" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Kkar4GxZ3Pt5WynWM7sy-207" parent="1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;spacingTop=0;spacingBottom=0;" value="&lt;div style=&quot;line-height: 160%;&quot;&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;IDefendable&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&quot;Interface&quot;&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));&quot;&gt;+ GetDefenders() : IDefender[]&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="90" width="320" x="-1000" y="180" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

@@ -0,0 +1,8 @@
package org.project.Interface;
import org.project.entity.Entity;
public interface IAttachable {
public void AttachTo(Entity entity);
public void DeattachFrom(Entity entity);
}
@@ -0,0 +1,9 @@
package org.project.Interface;
import org.project.constants.gameConstant.AttackPowerUp;
public interface IDamageable {
public void TakeDamage(int amount, AttackPowerUp[] powerUps);
public boolean IsDestroyed();
public void HandleZeroHealth();
}
@@ -0,0 +1,7 @@
package org.project.Interface;
public interface IDamager {
public void Damage(IDamageable target);
public IDamager[] GetUtils();
public int GetDamage();
}
@@ -0,0 +1,5 @@
package org.project.Interface;
public interface IDefendable {
public IDefender[] GetDefenders();
}
@@ -0,0 +1,8 @@
package org.project.Interface;
import org.project.constants.gameConstant.AttackPowerUp;
public interface IDefender {
public int Apply(int damage, AttackPowerUp[] powerUps);
public int GetDefense();
}
@@ -0,0 +1,5 @@
package org.project.Interface;
public interface IHealable {
public void Heal(int amount);
}
@@ -0,0 +1,6 @@
package org.project.constants.gameConstant;
public enum AttackPowerUp {
ANTI_SHIELD,
ANTI_CUSTOM
}
@@ -0,0 +1,7 @@
package org.project.constants.gameConstant;
public enum EntityState {
ALIVE,
DEAD,
FROZEN
}
@@ -0,0 +1,12 @@
package org.project.constants.gameConstant;
public enum ItemClass {
KEY,
SELLABLE,
UNNECESSARY,
ACCESSORY,
SHIELD,
WEAPON,
COSTUME,
}
@@ -0,0 +1,25 @@
package org.project.constants.gameConstant;
import org.project.item.Accessory.Accessory;
import org.project.item.Accessory.Costume;
import org.project.item.Accessory.Shield;
import org.project.item.Accessory.Weapon;
import org.project.item.KeyItem;
import org.project.item.SellableItem;
public final class ItemClassExt {
private ItemClassExt() {}
public static boolean Matches(ItemClass itemClass, Object subject) {
return switch (itemClass) {
case KEY -> subject instanceof KeyItem;
case SELLABLE -> subject instanceof SellableItem;
case UNNECESSARY -> subject.getClass() == SellableItem.class;
case ACCESSORY -> subject instanceof Accessory;
case WEAPON -> subject instanceof Weapon;
case COSTUME -> subject instanceof Costume;
case SHIELD -> subject instanceof Shield;
case null, default -> false;
};
}
}
@@ -1,21 +1,123 @@
package org.project.entity; package org.project.entity;
public interface Entity { import org.project.Interface.IDamageable;
void attack(Entity target); import org.project.Interface.IDefendable;
import org.project.Interface.IDefender;
import org.project.Interface.IHealable;
import org.project.constants.gameConstant.AttackPowerUp;
import org.project.constants.gameConstant.EntityState;
import org.project.constants.gameConstant.ItemClass;
import org.project.constants.gameConstant.ItemClassExt;
import org.project.item.Accessory.Costume;
import org.project.item.Accessory.Shield;
import org.project.item.Accessory.Weapon;
import org.project.item.Item;
import org.project.item.SellableItem;
void defend(); import java.util.ArrayList;
void heal(int health); public abstract class Entity implements IDamageable, IHealable, IDefendable {
void fillMana(int mana); public int MaxHealth;
public int Health;
private long Money;
private int BaseDamage;
private EntityState State;
public Weapon Weapon;
public Shield Shield;
public Costume Costume;
public ArrayList<Item> Inventory;
void takeDamage(int damage); public EntityState GetState() { return State; }
int getMaxHP(); public int GetBaseDamage() { return BaseDamage; }
int getMaxMP(); public long GetMoney() { return Money; }
/* public ArrayList<Item> GetInventory() { return Inventory; }
TODO: ADD OTHER REQUIRED AND BONUS METHODS
*/ public ArrayList<Item> GetInventoryByClass(ItemClass itemClass) {
ArrayList<Item> result = new ArrayList<>();
for (Item item : Inventory) {
if (ItemClassExt.Matches(itemClass, item)) {
result.add(item);
}
}
return result;
}
public void ModifyMoney(long amount, boolean dir) {
if (dir) {
Money += amount;
}
Money -= amount;
}
public void RestoreHealth() { Health = MaxHealth; }
@Override
public void Heal(int amount) {
Health += amount;
if (Health > MaxHealth) {
Health = MaxHealth;
}
}
@Override
public IDefender[] GetDefenders() {
return new IDefender[]{Shield, Costume};
}
@Override
public void TakeDamage(int amount, AttackPowerUp[] powerUps) {
IDefender[] defenders = GetDefenders();
for (IDefender defender : defenders) {
if (defender != null) {
amount = defender.Apply(amount, powerUps);
}
}
Health -= amount;
if (IsDestroyed()) {
HandleZeroHealth();
}
}
@Override
public boolean IsDestroyed() {
return Health <= 0;
}
@Override
public void HandleZeroHealth() {
this.State = EntityState.DEAD;
}
public void SellItem(SellableItem item) {
int price = item.GetPrice();
RemoveFromInventory(item);
Money += price;
}
public void SellByClass(ItemClass itemClass) {
ArrayList<Item> items = GetInventoryByClass(itemClass);
for (Item item : items) {
SellItem((SellableItem) item);
}
}
public void AddToInventory(Item item) {
Inventory.add(item);
}
public void RemoveFromInventory(Item item) {
Inventory.remove(item);
}
} }
@@ -36,7 +36,7 @@ public abstract class Player {
@Override @Override
public void takeDamage(int damage) { public void takeDamage(int damage) {
hp -= damage - armor.getDefense(); hp -= damage - armor.GetDefense();
} }
@Override @Override
@@ -0,0 +1,57 @@
package org.project.item.Accessory;
import org.project.Interface.IAttachable;
import org.project.Interface.IDamageable;
import org.project.constants.gameConstant.AttackPowerUp;
import org.project.entity.Entity;
import org.project.item.SellableItem;
public abstract class Accessory extends SellableItem implements IDamageable, IAttachable {
private int Health;
private final int MaxHealth;
public Accessory (String name, Entity owner, int price, int health, int maxHealth) {
super(name, owner, price);
this.Health = health;
this.MaxHealth = maxHealth;
}
public int GetHealth() {
return Health;
}
public int GetMaxHealth() { return MaxHealth; }
@Override
public int GetPrice() {
int basePrice = super.GetPrice();
return basePrice * (Health/MaxHealth);
}
@Override
public void TakeDamage(int amount, AttackPowerUp[] powerUps) {
Health -= amount;
if (IsDestroyed()) {
HandleZeroHealth();
}
}
@Override
public boolean IsDestroyed() {
return Health < 0;
}
@Override
public void HandleZeroHealth() {
this.DeattachFrom(this.Owner);
this.Owner.Inventory.remove(this);
}
@Override
public abstract void AttachTo(Entity entity);
@Override
public abstract void DeattachFrom(Entity entity);
}
@@ -0,0 +1,48 @@
package org.project.item.Accessory;
import org.project.Interface.IDefender;
import org.project.constants.gameConstant.AttackPowerUp;
import org.project.entity.Entity;
import java.util.Arrays;
public class Costume extends Accessory implements IDefender {
private final int Defense;
public Costume(String name, Entity owner, int price, int health, int maxHealth, int defense) {
super(name, owner, price, health, maxHealth);
this.Defense = defense;
}
@Override
public int GetDefense() {
return Defense;
}
@Override
public int Apply(int damage, AttackPowerUp[] powerUps) {
if (Arrays.binarySearch(powerUps, AttackPowerUp.ANTI_CUSTOM) < 0) {
return damage;
}
if (damage <= Defense) {
this.TakeDamage(damage, null);
return 0;
}
this.TakeDamage(Defense, null);
return damage - Defense;
}
@Override
public void AttachTo(Entity entity) {
entity.RemoveFromInventory(this);
entity.Costume = this;
}
@Override
public void DeattachFrom(Entity entity) {
entity.Costume = null;
entity.AddToInventory(this);
}
}
@@ -0,0 +1,48 @@
package org.project.item.Accessory;
import org.project.Interface.IDefender;
import org.project.constants.gameConstant.AttackPowerUp;
import org.project.entity.Entity;
import java.util.Arrays;
public class Shield extends Accessory implements IDefender {
private final int Defense;
public Shield (String name, Entity owner, int price, int health, int maxHealth, int defense) {
super(name, owner, price, health, maxHealth);
this.Defense = defense;
}
@Override
public int GetDefense() {
return Defense;
}
@Override
public int Apply(int damage, AttackPowerUp[] powerUps) {
if (Arrays.binarySearch(powerUps, AttackPowerUp.ANTI_SHIELD) < 0) {
return damage;
}
if (damage <= Defense) {
this.TakeDamage(damage, null);
return 0;
}
this.TakeDamage(Defense, null);
return damage - Defense;
}
@Override
public void AttachTo(Entity entity) {
entity.RemoveFromInventory(this);
entity.Shield = this;
}
@Override
public void DeattachFrom(Entity entity) {
entity.Shield = null;
entity.AddToInventory(this);
}
}
@@ -0,0 +1,28 @@
package org.project.item.Accessory;
import org.project.entity.Entity;
public class Weapon extends Accessory {
private final int Damage;
public Weapon (String name, Entity owner, int price, int health, int maxHealth, int damage) {
super(name, owner, price, health, maxHealth);
this.Damage = damage;
}
public int GetDamage() {
return Damage;
}
@Override
public void AttachTo(Entity entity) {
entity.RemoveFromInventory(this);
entity.Weapon = this;
}
@Override
public void DeattachFrom(Entity entity) {
entity.Weapon = null;
entity.AddToInventory(this);
}
}
@@ -2,10 +2,16 @@ package org.project.item;
import org.project.entity.Entity; import org.project.entity.Entity;
public interface Item { public abstract class Item {
void use(Entity target); private final String Name;
public Entity Owner;
/* public Item (String name, Entity owner) {
TODO: ADD OTHER REQUIRED AND BONUS METHODS this.Name = name;
*/ this.Owner = owner;
}
public String getName() {
return Name;
}
} }
@@ -0,0 +1,9 @@
package org.project.item;
import org.project.entity.Entity;
public class KeyItem extends Item {
public KeyItem (String name, Entity owner) {
super(name, owner);
}
}
@@ -0,0 +1,16 @@
package org.project.item;
import org.project.entity.Entity;
public class SellableItem extends Item{
private final int Price;
public SellableItem (String name, Entity owner, int price) {
super(name, owner);
this.Price = price;
}
public int GetPrice() {
return Price;
}
}
@@ -1,42 +0,0 @@
package org.project.item.armors;
// TODO: UPDATE IMPLEMENTATION
public abstract class Armor {
private int defense;
private int maxDefense;
private int durability;
private int maxDurability;
private boolean isBroke;
public Armor(int defense, int durability) {
this.defense = defense;
this.durability = durability;
}
public void checkBreak() {
if (durability <= 0) {
isBroke = true;
defense = 0;
}
}
// TODO: (BONUS) UPDATE THE REPAIR METHOD
public void repair() {
isBroke = false;
defense = maxDefense;
durability = maxDurability;
}
public int getDefense() {
return defense;
}
public int getDurability() {
return durability;
}
public boolean isBroke() {
return isBroke;
}
}
@@ -1,6 +0,0 @@
package org.project.item.armors;
// TODO: UPDATE IMPLEMENTATION
public class KnightArmor {
// TODO: DESIGN ARMOR'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR
}
@@ -1,8 +0,0 @@
package org.project.item.consumables;
// TODO: UPDATE IMPLEMENTATION
public abstract class Consumable {
/*
TODO: ADD OTHER REQUIRED AND BONUS METHODS
*/
}
@@ -1,16 +0,0 @@
package org.project.item.consumables;
import org.project.entity.Entity;
// TODO: UPDATE IMPLEMENTATION
public class Flask {
/*
THIS IS AN EXAMPLE OF A CONSUMABLE DESIGN.
*/
// TODO: UPDATE USE METHOD
@Override
public void use(Entity target) {
target.heal(target.getMaxHP() / 10);
}
}
@@ -1,26 +0,0 @@
package org.project.item.weapons;
import org.project.entity.Entity;
import java.util.ArrayList;
// TODO: UPDATE IMPLEMENTATION
public class Sword {
/*
THIS IS AN EXAMPLE OF A WEAPON DESIGN.
*/
int abilityCharge;
public Sword() {
// TODO: DESIGN SWORD'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR
}
// TODO: (BONUS) UPDATE THE UNIQUE ABILITY
public void uniqueAbility(ArrayList<Entity> targets) {
abilityCharge += 2;
for (Entity target : targets) {
target.takeDamage(getDamage());
}
}
}
@@ -1,35 +0,0 @@
package org.project.item.weapons;
import org.project.entity.Entity;
// TODO: UPDATE IMPLEMENTATION
public abstract class Weapon {
private int damage;
private int manaCost;
/*
TODO: ADD OTHER REQUIRED AND BONUS ATTRIBUTES
*/
public Weapon(int damage, int manaCost) {
this.damage = damage;
this.manaCost = manaCost;
}
@Override
public void use(Entity target) {
target.takeDamage(damage);
}
public int getDamage() {
return damage;
}
public int getManaCost() {
return manaCost;
}
/*
TODO: ADD OTHER REQUIRED AND BONUS METHODS
*/
}
@@ -0,0 +1,4 @@
package org.project.util;
public class DisplayItem {
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB