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); }
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); }
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); } }