예제 #1
0
 public void Apply()
 {
     foreach (var otherProductInTree in _product.GetOtherTreeProducts())
     {
         OutputEvents.Add(new UpdateProduct(otherProductInTree, _product.Stock));
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 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));
     }
 }
예제 #4
0
 public void Apply()
 {
     if (_product.IsParent())
     {
         foreach (var child in _product.GetOtherTreeProducts())
         {
             OutputEvents.Add(new EndProduct(child));
         }
     }
 }
예제 #5
0
        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);
            }
        }