Ejemplo n.º 1
0
        public bool Update(InteractionEvent interactionEvent, InteractionReference reference)
        {
            if (Interaction.Update(interactionEvent, reference))
            {
                return(true);
            }

            ApplyRequirement(interactionEvent);
            return(false);
        }
Ejemplo n.º 2
0
        public void ClientInteract(InteractionEvent interactionEvent, IInteraction interaction,
                                   InteractionReference reference)
        {
            IClientInteraction clientInteraction = interaction.CreateClient(interactionEvent);

            if (clientInteraction != null)
            {
                clientInteractions.Add(new ClientInteractionInstance(clientInteraction,
                                                                     interactionEvent, reference));
            }
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public ClientInteractionInstance(IClientInteraction interaction, InteractionEvent interactionEvent, InteractionReference reference)
 {
     Interaction = interaction;
     Event       = interactionEvent;
     Reference   = reference;
 }
Ejemplo n.º 6
0
 public void Cancel(InteractionEvent interactionEvent, InteractionReference reference)
 {
     Interaction.Cancel(interactionEvent, reference);
 }
Ejemplo n.º 7
0
 public abstract void Cancel(InteractionEvent interactionEvent, InteractionReference reference);
Ejemplo n.º 8
0
 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)));
 }
Ejemplo n.º 10
0
 public InteractionInstance(IInteraction interaction, InteractionEvent interactionEvent, InteractionReference reference, NetworkConnection owner)
 {
     Interaction = interaction;
     Event       = interactionEvent;
     Reference   = reference;
     Owner       = owner;
 }