public bool Update(InteractionEvent interactionEvent, InteractionReference reference) { if (Interaction.Update(interactionEvent, reference)) { return(true); } ApplyRequirement(interactionEvent); return(false); }
public void ClientInteract(InteractionEvent interactionEvent, IInteraction interaction, InteractionReference reference) { IClientInteraction clientInteraction = interaction.CreateClient(interactionEvent); if (clientInteraction != null) { clientInteractions.Add(new ClientInteractionInstance(clientInteraction, interactionEvent, reference)); } }
public void CancelInteraction(InteractionReference reference) { InteractionInstance instance = interactions.FirstOrDefault(i => Equals(reference, i.Reference)); if (instance == null) { return; } RpcCancelInteraction(reference.Id); instance.Interaction.Cancel(instance.Event, reference); interactions.Remove(instance); }
public InteractionReference Interact(InteractionEvent interactionEvent, IInteraction interaction) { InteractionReference reference = new InteractionReference(Random.Range(1, Int32.MaxValue)); if (!SupportsMultipleInteractions) { for (int index = interactions.Count - 1; index >= 0; index--) { InteractionInstance instance = interactions[index]; CancelInteraction(instance.Reference); } } interactions.Add(new InteractionInstance(interaction, interactionEvent, reference)); return(reference); }
public ClientInteractionInstance(IClientInteraction interaction, InteractionEvent interactionEvent, InteractionReference reference) { Interaction = interaction; Event = interactionEvent; Reference = reference; }
public void Cancel(InteractionEvent interactionEvent, InteractionReference reference) { Interaction.Cancel(interactionEvent, reference); }
public abstract void Cancel(InteractionEvent interactionEvent, InteractionReference reference);
public virtual bool Start(InteractionEvent interactionEvent, InteractionReference reference) { startTime = Time.time; lastCheck = startTime; return(true); }
public InteractionInstance GetInstanceFromReference(InteractionReference reference) { return(interactions.FirstOrDefault(x => x.Reference.Equals(reference))); }
public InteractionInstance(IInteraction interaction, InteractionEvent interactionEvent, InteractionReference reference, NetworkConnection owner) { Interaction = interaction; Event = interactionEvent; Reference = reference; Owner = owner; }