예제 #1
0
 private void OnCompleteBounty(BountyRef bounty)
 {
     titleText.text      = $"Bounty Complete: {bounty.ReferencedBounty.Name}";
     bountyInfoText.text = bounty.ReferencedBounty.Info;
     SetRewardViews(bounty.ReferencedBounty.RewardItems);
     Show();
 }
    public void AddBounty(Bounty bounty)
    {
        BountyRef bountyRef = bountyList.Add(bounty);

        if (bountyRef != null)
        {
            startBountyEvent.Invoke(bountyRef);
        }
    }
예제 #3
0
    public BountyRef Add(Bounty bounty)
    {
        Debug.Assert(bounty != null, "Attempting to add null bounty to BountyList");

        BountyRef foundBounty = bountyList.Find((b) => b.ReferencedBounty == bounty);

        if (foundBounty == null)
        {
            BountyRef bountyRef = new BountyRef(bounty);
            bountyList.Add(bountyRef);
            return(bountyRef);
        }

        return(null);
    }
    private void OnKillEntity(EntityKillData killdata)
    {
        List <BountyRef> completedBounties = new List <BountyRef>();

        for (int index = 0; index < bountyList.Count; ++index)
        {
            BountyRef bounty = bountyList.Get(index);
            if (bounty.ReferencedBounty.TargetEntity == killdata.TargetEntity)
            {
                bounty.CurrentProgress++;
                if (bounty.IsComplete())
                {
                    completedBounties.Add(bounty);
                }
            }
        }

        ProcessCompletedBounties(completedBounties);
    }
예제 #5
0
 public bool Remove(BountyRef bounty)
 {
     return(bountyList.Remove(bounty));
 }