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)); }
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; } }
public Goal(GoalEnum type, float priority) { this.type = type; this.priority = priority; }