Пример #1
0
        public PhysicalInteractionEntity InteractionBetween(InteractiveEntity main, InteractiveEntity other, Collision collision)
        {
            PhysicalInteractionEntity interaction;

            interaction       = main.physical * other.physical;
            interaction.other = other.gameObject;

            Debug.LogWarning("Need to finish here...");
            // interaction.intensity = collision.blablabla;

            return(interaction);
        }
Пример #2
0
        private static void Reaction(InteractiveEntity main, ChemicalElementEntity element, PhysicalInteractionEntity interaction)
        {
            InteractiveStatus status;

            // Calculate reaction :
            // 1. Result between 'current physical state' and 'possible element'
            // For example : Frozen * Fire = Neutral; Water
            status = main.physical * element;

            // Update entity interactive status
            main.physical = status.state;
            main.chemical = status.element;

            // main manage its new status && the interaction with the unknown entity
            main.InteractWith(status, interaction);
        }
Пример #3
0
        public static void InteractionBetween(InteractiveEntity main, InteractiveEntity other, Collision collision)
        {
            // declaration
            PhysicalInteractionEntity physicalInteraction;
            ChemicalElementEntity     chemicalInteraction;

            // interactions
            chemicalInteraction = chemistry.InteractionBetween(main, other);
            physicalInteraction = physic.InteractionBetween(main, other, collision);

            // reaction
            Reaction(main, chemicalInteraction, physicalInteraction);

            // extensions interaction + reaction
            foreach (InteractiveExtensionEngine ext in extensions)
            {
                ext.InteractionBetween(main, other);
            }
        }