///传入需要评估的内容类型,返回评估结果 public override double getMark(int valueType) { MarkVO mark; CardData card; double markValue = 0; for (int i = 0; i < ConfigConstant.CARD_HAND_MAX; i++) { card = this._cardGroup.handCards [i]; if (card != null && card.canUse) { mark = MarkVO.getCardMark(card.id); double tempMark = mark.getMark(valueType); if (mark.isPart) { markValue += tempMark * AIConstant.PART_IN_CARD_MARK_RATE; } else { markValue += tempMark; } } } return(markValue); }
///传入需要评估的范畴和内容类型,返回评估结果 public override double[] getTypeMark(int aspectType, int valueType) { MarkVO mark; CardData card; double[] marks = new double[AIConstant.MARK_COUNT]; for (int i = 0; i < ConfigConstant.CARD_HAND_MAX; i++) { card = this._cardGroup.handCards [i]; if (card != null && card.canUse) { mark = MarkVO.getCardMark(card.id); double[] tempMarks = mark.getTypeMark(aspectType, valueType); if (mark.isPart) { ArrayUtils.addArray(marks, ArrayUtils.multiplyArrayValue(tempMarks, AIConstant.PART_IN_CARD_MARK_RATE)); } else { ArrayUtils.addArray(marks, tempMarks); } } } return(marks); }
public static MarkVO getTriggerMark(string id) { //优先选择触发器的标记 MarkVO mark; if (MarkVO._markTriggerDic.ContainsKey(id)) { mark = MarkVO._markTriggerDic [id]; } else { mark = MarkVO.getCardMark(id); } return(mark); }
///判定当前状况使用各个牌的适应度 public double[] getCardFitnessArray() { List <CardData> handCards = this._aiPlayer.player.cardGroup.handCards; double[] fitnessList = new double[AIConstant.MARK_COUNT]; this.updateAimDeltaScales(); for (int i = 0; i < ConfigConstant.CARD_HAND_MAX; i++) { CardData card = handCards [i]; if (null != card) { if (card.canUse) { MarkVO mark = MarkVO.getCardMark(card.id); fitnessList [i] = this.getCardFitness(mark); } else { fitnessList [i] = 0; } } } return(fitnessList); }