Example #1
0
        public virtual Vector3Int GetJobLocation(BlockJobInstance instance)
        {
            if (!PandaJobFactory.TryGetActiveGoal(instance, out var goal))
            {
                goal = new ForagingGoal(instance, instance.Position, LootTable, ForagingTimeMinSec, ForagingTimeMaxSec, LuckMod);
                PandaJobFactory.SetActiveGoal(instance, goal);
            }

            return(goal.GetPosition());
        }
        public virtual Vector3Int GetJobLocation(BlockJobInstance instance)
        {
            if (!PandaJobFactory.TryGetActiveGoal(instance, out var goal))
            {
                if (StorageType == PorterJobType.ToCrate)
                {
                    var stc = new StockpikeToCrateGoal(instance);
                    PandaJobFactory.SetActiveGoal(instance, stc);
                    return(stc.GetPosition());
                }
                else
                {
                    var cts = new CrateToStockpikeGoal(instance);
                    PandaJobFactory.SetActiveGoal(instance, cts);
                    return(cts.GetPosition());
                }
            }

            return(goal.GetPosition());
        }