Adding TODO and fixing after-merging code

This commit is contained in:
Nikita Iryupin 2020-12-25 19:03:26 +01:00
parent 270654e5ea
commit 88543d0c68
5 changed files with 27 additions and 25 deletions

View File

@ -43,24 +43,25 @@ public class NodeFactory
System.err.println("! Fatal error in NodeFactory: " + e.getMessage()); System.err.println("! Fatal error in NodeFactory: " + e.getMessage());
} }
switch (Objects.requireNonNull(nodeType)) // switch (Objects.requireNonNull(nodeType))
{ // {
case Farmer: // //TODO Money constructor
n = new Farmer(startMoney); // case Farmer:
break; // n = new Farmer(startMoney);
case Processor: // break;
n = new Processor(startMoney); // case Processor:
break; // n = new Processor(startMoney);
case Distributor: // break;
n = new Distributor(startMoney); // case Distributor:
break; // n = new Distributor(startMoney);
case Seller: // break;
n = new Seller(startMoney); // case Seller:
break; // n = new Seller(startMoney);
case Customer: // break;
n = new Customer(startMoney); // case Customer:
break; // n = new Customer(startMoney);
} // break;
// }
String[] subs = subsChannels.split(";"); String[] subs = subsChannels.split(";");
//todo Node subscription to channels by parser data //todo Node subscription to channels by parser data
@ -68,7 +69,7 @@ public class NodeFactory
for (String s : subs) for (String s : subs)
{ {
ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance(); ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance();
n.subscribeToChannel(temp.findByName(s)); // n.subscribeToChannel(temp.findByType(s)); //TODO String to enum
} }
return n; return n;

View File

@ -74,9 +74,9 @@ public class NodeBase implements ChannelObserver {
} }
public Transaction readNextTransaction(ChannelBase channel) { public Transaction readNextTransaction(ChannelBase channel) {
//TODO
return null;
return channel.getNextTransaction(); // return channel.getNextTransaction();
} }

View File

@ -27,6 +27,7 @@ public class Product
this.money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create(); this.money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create();
} }
//TODO money int constructor
public Product(String name, ProductType productType, MonetaryAmount money) public Product(String name, ProductType productType, MonetaryAmount money)
{ {
this.name = name; this.name = name;

View File

@ -4,7 +4,7 @@ import cz.cvut.fel.sit.omo.foodchain.node.Customer;
public class ConsumeProductStep extends ScenarioStep { public class ConsumeProductStep extends ScenarioStep {
private Customer node; private final Customer node;
public ConsumeProductStep(Customer node) { public ConsumeProductStep(Customer node) {
this.node = node; this.node = node;

View File

@ -7,8 +7,8 @@ import cz.cvut.fel.sit.omo.foodchain.product.Product;
public class GenerateProductStep extends ScenarioStep { public class GenerateProductStep extends ScenarioStep {
private Farmer node; private final Farmer node;
private Product product; private final Product product;
public GenerateProductStep(Farmer node) { public GenerateProductStep(Farmer node) {
this.node = node; this.node = node;