Beispiel #1
0
 public void AddOutgoingAttachment(TagSet rule, OutgoingAttachment outgoingAttachment)
 {
     if (rule != null)
     {
         outgoingAttachments.Add(rule, outgoingAttachment);
     }
 }
 public OutgoingAttachment Clone()
 {
     var oa = new OutgoingAttachment();
     oa.position = position;
     oa.attachRange = attachRange;
     oa.facing = facing;
     oa.targetAnimationContext = targetAnimationContext;
     oa.targetAttachmentContext = targetAttachmentContext;
     return oa;
 }
        public OutgoingAttachment Clone()
        {
            var oa = new OutgoingAttachment();

            oa.position                = this.position;
            oa.attachRange             = this.attachRange;
            oa.facing                  = this.facing;
            oa.targetAnimationContext  = this.targetAnimationContext;
            oa.targetAttachmentContext = this.targetAttachmentContext;
            return(oa);
        }
Beispiel #4
0
        public bool RemoveOutgoingAttachment(OutgoingAttachment outgoingAttachment)
        {
            for (int i = 0; i < outgoingAttachments.Count; i++)
            {
                if (ReferenceEquals(outgoingAttachments.Values[i], outgoingAttachment))
                {
                    outgoingAttachments.RemoveAt(i);
                    return(true);
                }
            }

            return(false);
        }
Beispiel #5
0
        public bool RemoveOutgoingAttachment(OutgoingAttachment outgoingAttachment)
        {
            string key = null;

            foreach (var entry in outgoingAttachments)
            {
                if (ReferenceEquals(entry.Value, outgoingAttachment))
                {
                    key = entry.Key;
                }
            }
            if (key != null)
            {
                return(outgoingAttachments.Remove(key));
            }
            return(false);
        }
Beispiel #6
0
        public OutgoingAttachmentView(OutgoingAttachment sourceAttachment, Position sourcePosition, bool sourceFlipX)
        {
            this.attachment = sourceAttachment;
            this.facingLeft = sourceFlipX;
            this.position   = sourcePosition;

            if (sourceAttachment != null)
            {
                this.position += sourceAttachment.position.MaybeFlipX(sourceFlipX);

                this.attachRange = sourceAttachment.attachRange;
                if (sourceFlipX)
                {
                    this.attachRange.FlipXInPlace();
                }
            }
            else
            {
                this.attachRange = default(AABB);
            }

            this.attachRange += this.position;
        }