Fixed some stuff
This commit is contained in:
parent
643bf23c0b
commit
22369d7b70
@ -25,14 +25,14 @@ public class NodeFactory
|
||||
NodeBase n = null;
|
||||
NodeType nodeType = null;
|
||||
String subsChannels = "";
|
||||
int startMoney = 0;
|
||||
double startMoney = 0;
|
||||
|
||||
try
|
||||
{
|
||||
nodeType = NodeType.valueOf(input.getAttribute("type"));
|
||||
|
||||
subsChannels = input.getChild("subscribed_channels");
|
||||
startMoney = Integer.getInteger(input.getChild("money"));
|
||||
startMoney = Double.parseDouble(input.getChild("money"));
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
@ -43,25 +43,25 @@ public class NodeFactory
|
||||
System.err.println("! Fatal error in NodeFactory: " + e.getMessage());
|
||||
}
|
||||
|
||||
// switch (Objects.requireNonNull(nodeType))
|
||||
// {
|
||||
// //TODO Money constructor
|
||||
// case Farmer:
|
||||
// n = new Farmer(startMoney);
|
||||
// break;
|
||||
// case Processor:
|
||||
// n = new Processor(startMoney);
|
||||
// break;
|
||||
// case Distributor:
|
||||
// n = new Distributor(startMoney);
|
||||
// break;
|
||||
// case Seller:
|
||||
// n = new Seller(startMoney);
|
||||
// break;
|
||||
// case Customer:
|
||||
// n = new Customer(startMoney);
|
||||
// break;
|
||||
// }
|
||||
switch (Objects.requireNonNull(nodeType))
|
||||
{
|
||||
//TODO Money constructor
|
||||
case Farmer:
|
||||
n = new Farmer(startMoney);
|
||||
break;
|
||||
case Processor:
|
||||
n = new Processor(startMoney);
|
||||
break;
|
||||
case Distributor:
|
||||
n = new Distributor(startMoney);
|
||||
break;
|
||||
case Seller:
|
||||
n = new Seller(startMoney);
|
||||
break;
|
||||
case Customer:
|
||||
n = new Customer(startMoney);
|
||||
break;
|
||||
}
|
||||
|
||||
String[] subs = subsChannels.split(";");
|
||||
//todo Node subscription to channels by parser data
|
||||
|
||||
@ -27,7 +27,6 @@ public class Product
|
||||
this.money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create();
|
||||
}
|
||||
|
||||
//TODO money int constructor
|
||||
public Product(String name, ProductType productType, Double money)
|
||||
{
|
||||
this.name = name;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user