Beispiel #1
0
 public MSVolunteer(Vector3 position, Node path_to_mobber, MSUnit target, MSTower office, MSMap map, float initRotation)
     : base(position, path_to_mobber, map, false, initRotation)
 {
     this.target = target;
     this.office = office;
     this.isGoingToMobber = true;
 }
Beispiel #2
0
 public void remove(MSUnit unit)
 {
     targetList.Remove(unit);
 }
Beispiel #3
0
 public void AddUnit(MSUnit unit)
 {
     units.Add(unit);
 }
Beispiel #4
0
 public override void Follow(MSUnit unit)
 {
     base.Follow(unit);
     MSMobber mobber = unit as MSMobber;
     mobber.AddMember(this);
     foreach (MSMobber m in mobber.GetMobList())
     {
         mobList.Add(m);
     }
 }
Beispiel #5
0
        public void SendVolunteer(MSMap map, MSUnit unit, MSTower office)
        {
            Node path1 = map.GetPath(new Vector2(office.Row, office.Column), unit.TileCoordinate);

            Node pathEnd = path1;
            while (pathEnd.next != null)
            {
                pathEnd = pathEnd.next;
            }
            pathEnd.next = unit.Path;

            MSVolunteer volunteer = new MSVolunteer
            (
                office.Position + MSUnit.UNITZ_POSITION,
                path1,
                unit,
                office,
                map,
                0
            );

            MSUnitHandler.GetInstance().AddUnit(volunteer);
        }