Exemple #1
0
        public static decimal GetRequiredCalories(GoalEnum Goal, decimal DailyCalorie, decimal GoalPercent)
        {
            decimal _RequiredCalories = 0;

            if (Goal == GoalEnum.MAINTAIN_WEIGHT)
            {
                _RequiredCalories = DailyCalorie;
            }
            else if (Goal == GoalEnum.LOSE_WEIGHT)
            {
                _RequiredCalories = DailyCalorie * (GoalPercent / 100M);
            }
            else if (Goal == GoalEnum.GAIN_WEIGHT)
            {
                _RequiredCalories = DailyCalorie / (GoalPercent / 100M);
            }

            return(_RequiredCalories.ToString("N2").toDecimal(0));
        }
Exemple #2
0
    void AddGoal(ref GoapAgent agent, GoalEnum goal)
    {
        switch (goal)
        {
        case GoalEnum.Idle:
            agent.Goals.Add(new IdleGoal(agent));
            break;

        case GoalEnum.Patrol:
            agent.Goals.Add(new PatrolGoal(agent));
            break;

        case GoalEnum.Combat:
            agent.Goals.Add(new CombatGoal(agent));
            break;

        case GoalEnum.Cover:
            agent.Goals.Add(new CoverGoal(agent));
            break;
        }
    }
Exemple #3
0
	public Goal(GoalEnum type, float priority) {
		this.type = type;
		this.priority = priority;
	}
Exemple #4
0
 public Goal(GoalEnum type, float priority)
 {
     this.type     = type;
     this.priority = priority;
 }