Private
Public Access
Removed strict types
This commit is contained in:
1 parent
5844e489da
commit
31ad37aa69
2 files changed
+4
-7
No files matched your search
+1
-1
@@ -45,7 +45,7 @@ namespace Advanced_Software_Engineering.Verbs.Value {
|
||||
return true;
|
||||
}
|
||||
|
||||
public DeclareVariable(Drawer drawer, string type, string assignment) {
|
||||
public DeclareVariable(Drawer drawer, string assignment) {
|
||||
this.drawer = drawer;
|
||||
|
||||
//seperate assignment characters from everything else
|
||||
|
||||
@@ -32,19 +32,16 @@ namespace Advanced_Software_Engineering {
|
||||
if (drawer.CheckVariableExists(command)) {
|
||||
|
||||
if (commandParameters.Length == 1) {
|
||||
//return new UpdateVariable(drawer, );
|
||||
return new UpdateVariable(drawer, command, ValueFactory.CreateValue(drawer, commandParameters[0]));
|
||||
} else throw new Exception(command + "needs something to be assigned to it");
|
||||
}
|
||||
|
||||
//process declarations
|
||||
if (!(commandParameters == null))
|
||||
switch (command) {
|
||||
case "int":
|
||||
case "double":
|
||||
case "bool":
|
||||
case "color":
|
||||
case "var":
|
||||
if (commandParameters.Length == 1) {
|
||||
return new DeclareVariable(drawer, command, commandParameters[0]);
|
||||
return new DeclareVariable(drawer, commandParameters[0]);
|
||||
} else throw new Exception(command + "s need to be initialised");
|
||||
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user