示例#1
0
        /*---------------------------------------------*/
        /*---------------------------------------------*/

        public static int GetOpinionToNewsParam(AuditoryType auditory, NewsParamType param, int value)
        {
            var preferValue = Auditories.Find(a => a.Type == auditory)
                              .opinionsNewsParams[(int)param];
            var opinion = preferValue - value;

            if (opinion < Consts.Params.OPINION_MIN)
            {
                opinion = Consts.Params.OPINION_MIN;
            }
            else if (opinion > Consts.Params.OPINION_MAX)
            {
                opinion = Consts.Params.OPINION_MAX;
            }
            return(opinion);
        }
示例#2
0
 public static int GetOpinionToNewsType(AuditoryType auditory, NewsType newsType)
 => Auditories.Find(a => a.Type == auditory)
 .opinionsNewsTypes[(int)newsType];