Skip to content

Instantly share code, notes, and snippets.

@recursor94
Created April 26, 2014 23:37
Show Gist options
  • Save recursor94/11333953 to your computer and use it in GitHub Desktop.
Save recursor94/11333953 to your computer and use it in GitHub Desktop.
public class LeaveGifts : ChildSituation<GiftGiverSituation>
{ //** situation that finds santa object, routes to it and leaves presents.
public LeaveGifts(GiftGiverSituation parent) : base(parent)
{
}
public override void Init(GiftGiverSituation parent)
{
this.findGiftGiverObject();
this.Parent.Worker.RouteToObjectRadius(findGiftGiverObject(), 3f);
}
public GameObject findGiftGiverObject()
{
List <GameObject> lotObjects = this.Lot.GetObjects<GameObject>(new Predicate<GameObject>(this.isGiftGiverObject));
return lotObjects[0];
// PlumbBob.SelectedActor.ShowTNSIfSelectable(lotObjects[0] + "" , Sims3.UI.StyledNotification.NotificationStyle.kSimTalking);
}
private bool isGiftGiverObject(GameObject obj)
{
//predicate function to find the object
return obj.GetClassName() == "Sims3.Gameplay.Objects.Recursor94.GiftGiverObject";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment