Example #1
0
        public TEntity Handle(Command command)
        {
            var seed = new TEntity();

            return
                (_handlers
                 .React(command, seed)
                 .messages
                 .Aggregate(seed, (prevState, evnt) => _behaviors.React(evnt, prevState).state));
        }
Example #2
0
    //Same reaction mechanic, but no volume calculations
    public void MakepHIndicators(SelectionObjectData object1, SelectionObjectData object2)
    {
        //Two objects react to get a resultant object
        System.Enum result = Reactions.React(object1.item, object2.item);

        //pH papers doesn't have volume. So, volume calculations is not needed

        //pH calculations is also needed.

        //TODO: Check if the item is present in the inventory
        //If present, compare it with it's slot's item description
        //If not, add it to a new slot along with the item description information to the slot.
    }
Example #3
0
        void GenerateSalt(Character c)
        {
            Debug.Log("Generating salt......Under progress");
            Debug.Log("Player chemical: " + player.chemical);
            Debug.Log("Enemy chemical: " + c.chemical);

            SaltsList resultantSalt = SaltsList.NaCl;

            //System.Enum.TryParse(Reactions.reactionDictionary[player.chemical][c.chemical].ToString(), out resultantSalt);
            System.Enum.TryParse(Reactions.React(player.chemical, c.chemical).ToString(), out resultantSalt);
            //resultantSalt = System.Enum.Parse(typeof(Salt), Reactions.reactionDictionary[player.chemical][c.chemical].ToString());

            if (resultantSalt != SaltsList.Null)
            {
                Debug.Log("salt generated: " + resultantSalt);
            }
            else
            {
                Debug.Log("Salt is null....Something went wrong");
            }
        }
Example #4
0
    //Combine acids and bases....Volume calculation is present
    public void Combine(SelectionObjectData object1, SelectionObjectData object2)
    {
        //Two objects react to get a resultant object
        System.Enum result = Reactions.React(object1.item, object2.item);

        //Get the item description from the item manager
        ItemBase         item        = ItemManager.instance.itemDictionary[result].GetComponent <ItemBase>();
        ItemsDescription description = item.itemProperties.itemDescription;


        //Perform the volume and pH calculations here.
        int pH = 9; //TODO: this must be calculated using the formula

        if (pH != description.pHValue)
        {
            //TODO: Assign a new slot in the inventory and add it
            //TODO: Add new item Description data along with it while adding
        }

        //TODO: Check if the item is present in the inventory
        //If present, compare it with it's slot's item description
        //If not, add it to a new slot along with the item description information to the slot.
    }
Example #5
0
 public void Process()
 {
     Reactions.React(node.GasMix, node.PositionMatrix);
 }
 protected virtual void OnDynamicTriggerFired(ReactiveTriggerBase sourceTrigger)
 {
     Reactions.React();
 }