예제 #1
0
 public override void HandleVillain(BaseVillain villain)
 {
     if (villain is Clayface)
     {
         villain.HandledBy = this;
     }
     else
     {
         Subordinate.HandleVillain(villain);
     }
 }
 public override void Verify()
 {
     base.Verify();
     Debug.Assert(Subordinate != null);
     Debug.Assert(Subordinate.ExistsInVersion(OldVersion));
     Debug.Assert(Subordinate.GetInVersion(NewVersion) == Subordinate);
     Debug.Assert(NewParent.Components.Contains(Subordinate));
     Debug.Assert(OldParent.Components.Contains(SubordinateOldVersion));
     Debug.Assert(NewParent != OldParent);
     Debug.Assert(NewParent.GetInVersion(OldVersion) != OldParent);
 }
예제 #3
0
    private string GetSubordinateList(int SubLevel)
    {
        foreach (Employee Subordinate in this.Subordinates.OrderBy(sb => sb.FirstName).ThenBy(sb => sb.LastName))
        {
            sb.Append(new string('\t', SubLevel) + ((SubLevel == 1) ? "• " : "– ") + Subordinate.ToString() + Environment.NewLine);
            if (Subordinate.Subordinates != null && Subordinate.Subordinates.Count > 0)
            {
                sb.Append(Subordinate.GetSubordinateList(SubLevel + 1) + Environment.NewLine);
            }
        }
        string result = sb.ToString();

        sb.Clear();
        return(result);
    }
예제 #4
0
 public override void HandleVillain(BaseVillain villain)
 {
     if (villain is Joker)
     {
         villain.HandledBy = this;
     }
     else if (villain is Bane)
     {
         throw new Exception("Bane brakes Batman's back!");
     }
     else
     {
         Subordinate.HandleVillain(villain);
     }
 }
예제 #5
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag != "subordinate")
        {
            massMovement = false;
        }
        else
        {
            Subordinate otherThing = other.gameObject.GetComponent <Subordinate> ();

            if (otherThing.blue != this.blue && fightOrdered)
            {
                if (!otherThing.getFightOrdered())
                {
                    Destroy(other.gameObject);
                }
            }
        }
    }
예제 #6
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag.Equals("subordinate") || other.tag.Equals("barrierSubordinate"))
        {
            Subordinate touching = other.gameObject.GetComponent <Subordinate> ();

            if (touching.getBarrierOrdered())
            {
                if (touching.blue)
                {
                    setWall(true);
                }
                else
                {
                    setWall(false);
                }
            }
        }
    }
예제 #7
0
 static partial void AfterUpdateSubordinate(this Mapper mapper, Sample.Business.Employee source, Subordinate target);
예제 #8
0
        internal static void UpdateSubordinate(this Mapper mapper, Sample.Business.Employee source, Subordinate target)
        {
            // Verify null args:
            if (Object.ReferenceEquals(source, null))
            {
                return;
            }
            else if (Object.ReferenceEquals(target, null))
            {
                throw new Max.Domain.Mapping.MappingException("No target provided to map Subordinate on.");
            }

            // Perform base type mapping:
            mapper.UpdateSystemObject(source, target);

            // Perform mapping of properties:
            target.Id        = source.EmployeeID;
            target.Contact   = mapper.MapToContact(source.Contact);
            target.Gender    = source.Gender;
            target.BirthDate = source.BirthDate;
            target.HireDate  = source.HireDate;

            // Call partial AfterUpdate method:
            AfterUpdateSubordinate(mapper, source, target);
        }
예제 #9
0
        internal static Subordinate MapToSubordinate(this Mapper mapper, Sample.Business.Employee source, Subordinate target)
        {
            // Null maps to null:
            if (source == null)
            {
                return(null);
            }

            // Check if object already mapped (as in circular reference scenarios):
            object mappedTarget = mapper.GetMappedTarget(source);

            // If so, return mapped instance:
            if (Object.ReferenceEquals(mappedTarget, null) == false)
            {
                return((Subordinate)mappedTarget);
            }

            // Else, register mapping and map target:
            mapper.RegisterMapping(source, target);
            mapper.UpdateSubordinate(source, target);

            // Return mapped target:
            return(target);
        }