public void Apply() { foreach (var otherProductInTree in _product.GetOtherTreeProducts()) { OutputEvents.Add(new UpdateProduct(otherProductInTree, _product.Stock)); } }
public override void CreateStaticNodesIfNotPresent() { base.CreateStaticNodesIfNotPresent(); if (InputEvents.Count != 1) { InputEvents.Clear(); EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Start Dialogue"; InputEvents.Add(InputLink); } if (OutputEvents.Count != 3) { EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Game Finished"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Problem Encountered"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Navigation Required"; OutputEvents.Add(OutputLink); } }
public void Apply() { // Thanks to this method there's no need to have access to the products repository. // This only works because current structure is in memory, else we would have to update // the products affected by this sync rule via the repository. foreach (var otherProductInTree in _product.GetOtherTreeProducts()) { OutputEvents.Add(new EndProduct(otherProductInTree)); } }
public void Apply() { if (_product.IsParent()) { foreach (var child in _product.GetOtherTreeProducts()) { OutputEvents.Add(new EndProduct(child)); } } }
public override void CreateStaticNodesIfNotPresent() { base.CreateStaticNodesIfNotPresent(); if (InputEvents.Count != 3) { InputEvents.Clear(); EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Start New Game"; InputEvents.Add(InputLink); InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Load Saved Game"; InputEvents.Add(InputLink); InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Quit"; InputEvents.Add(InputLink); } if (OutputEvents.Count != 3) { EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Game Started"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Game Failed To Start"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Quit"; OutputEvents.Add(OutputLink); } }