Opdracht 1 final, "begin" opdracht 2

Co-authored-by: Aryan Lala (19097727) <A.E.Lala@student.hhs.nl>
This commit is contained in:
2023-04-26 14:39:59 +02:00
parent 4fe07a69f4
commit 30df0565e2
10 changed files with 298 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
#include "Interface.h"
Interface::Interface(){
Interface::~Interface(){
}

View File

@@ -5,10 +5,9 @@ class Interface
{
private:
public:
Interface();
virtual ~Interface(){};
virtual int x() = 0;
virtual int y() = 0;
virtual void move(int, int) = 0;
virtual ~Interface();
virtual int x() const = 0;
virtual int y() const = 0;
virtual void move(int, int) = 0;
};
#endif

View File

@@ -8,11 +8,11 @@ Positie::~Positie(){
}
int Positie::x(){
int Positie::x() const{
return X;
}
int Positie::y(){
int Positie::y() const{
return Y;
}

View File

@@ -10,8 +10,8 @@ private:
public:
Positie (int, int);
~Positie();
virtual int x();
virtual int y();
virtual int x() const;
virtual int y() const;
virtual void move (int, int);
};

View File

@@ -1,5 +1,5 @@
#include "Robot.h"
#include "Positie.h"
#include "Interface.h"
#include <iostream>

View File

@@ -6,13 +6,12 @@ class Interface;
class Robot{
private:
Interface *P;
//Positie *P = dynamic_cast<Positie*>(I);
Interface *P;
public:
Robot (Interface*);
virtual ~Robot();
void run();
void show();
~Robot();
virtual void run();
virtual void show();
};
#endif

View File

@@ -1,42 +1,48 @@
<mxfile host="65bd71144e">
<diagram id="hUXen1-xG9g13vyYE9lk" name="Page-1">
<mxGraphModel dx="1186" dy="652" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<mxGraphModel dx="838" dy="517" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="5" value="Positie" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="5" value="Positie" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="170" y="320" width="140" height="150" as="geometry"/>
</mxCell>
<mxCell id="6" value="- x : Int&lt;br&gt;- y : int" 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;" vertex="1" parent="5">
<mxCell id="6" value="- x : Int&lt;br&gt;- y : int" 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;" parent="5" vertex="1">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="+ move (int, int)&lt;br&gt;+ x : int&lt;br&gt;+ y : int" 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;" vertex="1" parent="5">
<mxCell id="7" value="+ move (int, int)&lt;br&gt;+ x : int&lt;br&gt;+ y : int" 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;" parent="5" vertex="1">
<mxGeometry y="60" width="140" height="90" as="geometry"/>
</mxCell>
<mxCell id="9" value="Interface" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="9" value="Interface" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="170" y="90" width="140" height="110" as="geometry"/>
</mxCell>
<mxCell id="10" value="+ move (int, int)&lt;br&gt;+ x : int&lt;br&gt;+ y : int" 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;" vertex="1" parent="9">
<mxCell id="10" value="+ move (int, int)&lt;br&gt;+ x : int&lt;br&gt;+ y : int" 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;" parent="9" vertex="1">
<mxGeometry y="30" width="140" height="80" as="geometry"/>
</mxCell>
<mxCell id="13" value="" style="endArrow=diamondThin;endFill=0;endSize=24;html=1;" edge="1" parent="1" target="10">
<mxCell id="13" value="" style="endArrow=diamondThin;endFill=0;endSize=24;html=1;" parent="1" target="10" edge="1">
<mxGeometry width="160" relative="1" as="geometry">
<mxPoint x="240" y="320" as="sourcePoint"/>
<mxPoint x="240" y="210" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="16" value="Robot" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="16" value="Robot" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="480" y="120" width="140" height="80" as="geometry"/>
</mxCell>
<mxCell id="17" value="+ show&lt;br&gt;+ run" 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;" vertex="1" parent="16">
<mxCell id="17" value="+ show&lt;br&gt;+ run" 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;" parent="16" vertex="1">
<mxGeometry y="30" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="20" value="" style="endArrow=classic;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="10">
<mxCell id="20" value="" style="endArrow=classic;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" target="10" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="480" y="160" as="sourcePoint"/>
<mxPoint x="425" y="120" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="21" value="1" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="435" y="125" width="30" height="30" as="geometry"/>
</mxCell>
<mxCell id="22" value="P" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="320" y="125" width="30" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>

BIN
Opdracht_1/main Executable file

Binary file not shown.