コード例 #1
0
        public void SaveDataAttribute([FromBody] AttributePair attribute)
        {
            int             assessmentId = Auth.AssessmentForUser();
            AdminTabManager manager      = new AdminTabManager();

            manager.SaveDataAttribute(assessmentId, attribute);
        }
コード例 #2
0
ファイル: MountEquipSubWnd.cs プロジェクト: atom-chen/tianyu
    List <AttributePair> CountAttributePair(List <AttributePair> _attrList, List <AttributePair> _addList)
    {
        List <AttributePair> attrs = _attrList;

        for (int i = 0, length = _addList.Count; i < length; i++)
        {
            AttributePair attI    = _addList[i];
            bool          contain = false;
            for (int j = 0, lenJ = attrs.Count; j < lenJ; j++)
            {
                AttributePair attJ = attrs[j];
                if (attI.tag == attJ.tag)
                {
                    attJ.Update(attI.tag, attI.value + attJ.value);
                    contain = true;
                }
            }
            if (!contain)
            {
                attrs.Add(attI);
            }
        }
        //Debug.Log("Count:"+attrs.Count);
        return(attrs);
    }
コード例 #3
0
    /// <summary>
    /// 获取属性的显示
    /// </summary>
    public static string GetAttributeNameAndValue(List <AttributePair> attrList)
    {
        StringBuilder builder = new StringBuilder();
        string        atkStr  = ConfigMng.Instance.GetUItext(266);
        string        defStr  = ConfigMng.Instance.GetUItext(267);
        bool          haveAtk = false;
        bool          haveDef = false;

        for (int i = 0, max = attrList.Count; i < max; i++)
        {
            AttributePair attr = attrList[i];
            switch (attr.tag)
            {
            case ActorPropertyTag.ATKUP:
                atkStr  = atkStr.Replace("#1", attr.value.ToString());
                haveAtk = true;
                break;

            case ActorPropertyTag.ATKDOWN:
                atkStr  = atkStr.Replace("#0", attr.value.ToString());
                haveAtk = true;
                break;

            case ActorPropertyTag.DEFUP:
                defStr  = defStr.Replace("#1", attr.value.ToString());
                haveDef = true;
                break;

            case ActorPropertyTag.DEFDOWN:
                defStr  = defStr.Replace("#0", attr.value.ToString());
                haveDef = true;
                break;

            default:
                builder.Append(ConfigMng.Instance.GetAttributeTypeName(attr.tag));
                builder.Append(":").Append(attr.value);
                if (i < max - 1 || haveAtk || haveDef)
                {
                    builder.Append("\n");
                }
                break;
            }
        }
        if (haveAtk)
        {
            builder.Append(atkStr);
        }
        if (haveDef)
        {
            builder.Append(defStr);
        }
        return(builder.ToString());
    }
コード例 #4
0
        public void AddAttributeFilterCondition(AttributePair attribute)
        {
            LogInformation(log.Here(), "get attribute:", JsonConvert.SerializeObject(attribute));

            string key = attribute.attributeName;

            if (this.context.savedAttributes.Keys.Contains(key))
            {
                this.context.savedAttributes[key] = attribute;
            }
            else
            {
                this.context.savedAttributes.Add(key, attribute);
            }
        }
コード例 #5
0
ファイル: NLUDataFrame.cs プロジェクト: wuxiaoxue/SmartKG
        public void AddAttribute(string intentName, NLUEntity entity, AttributePair attribute)
        {
            if (!this.attributeMap.Keys.Contains(intentName))
            {
                Dictionary <string, List <AttributePair> > wordToAttribute = new Dictionary <string, List <AttributePair> >();
                this.attributeMap.Add(intentName, wordToAttribute);
            }

            string key = entity.GetIdentity();

            if (!this.attributeMap[intentName].Keys.Contains(key))
            {
                this.attributeMap[intentName].Add(key, new List <AttributePair>());
            }

            this.attributeMap[intentName][key].Add(attribute);
        }
コード例 #6
0
        public Player() : base(Palette.PlayerColor, Palette.LightFloorForeground, 1)
        {
            Name   = "Rogue";
            Level  = 1;
            Health = new AttributePair(100);
            Energy = new AttributePair(100);

            Constitution = 10;
            Wisdom       = 15;
            Dexterity    = 10;
            Gold         = 100;

            CharacterClass = "Rogue";
            Experience     = 0;

            // SadConsole GameObject property
            IsVisible = true;
        }
コード例 #7
0
    public void Dispose()
    {
        target = null;

        health       = null;
        mainResourse = null;
        parameters   = null;
        states       = null;

        GlobalCooldown.Dispose();
        GlobalCooldown = null;

        SpellCast.Dispose();
        SpellCast = null;

        Buffs.Dispose();
        Buffs = null;

        Spells.Dispose();
        Spells = null;

        AbsorbEffects.Clear();
        AbsorbEffects = null;

        PeriodicEffects.Clear();
        PeriodicEffects = null;

        PreviousTargets.Clear();
        PreviousTargets = null;

        for (int i = 0; i < CharacterEventTypes.Count; i++)
        {
            CharacterEvents[i].Clear();
        }

        CharacterEvents.Clear();
        CharacterEvents = null;
    }
コード例 #8
0
    /// <summary>
    /// 获取属性的显示
    /// </summary>
    public static string GetAttributeNameAndValue(List <AttributePair> attrList, List <AttributePair> nextAttrList)
    {
        StringBuilder builder = new StringBuilder();

        if (attrList.Count != nextAttrList.Count)
        {
            Debug.LogError("强化前后的属性不一致!无法对比");
            return(string.Empty);
        }
        for (int i = 0, max = attrList.Count; i < max; i++)
        {
            AttributePair attr     = attrList[i];
            AttributePair nextAttr = nextAttrList[i];
            builder.Append(ConfigMng.Instance.GetAttributeTypeName(attr.tag));
            builder.Append(":+").Append(attr.value);
            builder.Append("  [00ff00]+").Append(nextAttr.value - attr.value).Append("[-]");
            if (i < max - 1)
            {
                builder.Append("\n");
            }
        }
        return(builder.ToString());
    }
コード例 #9
0
 public void SetAttribute(AttributePair attributeRef)
 {
     AttributeRef = attributeRef;
     lastValue    = int.MinValue;
     OnValueChanged();
 }
コード例 #10
0
    /// <summary>
    /// 获取属性的显示
    /// </summary>
    public static string GetAttributeWithStrengthValue(List <AttributePair> attrList, EquipmentInfo info)
    {
        StringBuilder builder = new StringBuilder();
        string        atkStr  = ConfigMng.Instance.GetUItext(266);
        string        defStr  = ConfigMng.Instance.GetUItext(267);
        bool          haveAtk = false;
        bool          haveDef = false;

        for (int i = 0, max = attrList.Count; i < max; i++)
        {
            AttributePair attr = attrList[i];
            switch (attr.tag)
            {
            case ActorPropertyTag.ATKUP:
                atkStr  = atkStr.Replace("#1", attr.value.ToString());
                haveAtk = true;
                break;

            case ActorPropertyTag.ATKDOWN:
                atkStr  = atkStr.Replace("#0", attr.value.ToString());
                haveAtk = true;
                break;

            case ActorPropertyTag.DEFUP:
                defStr  = defStr.Replace("#1", attr.value.ToString());
                haveDef = true;
                break;

            case ActorPropertyTag.DEFDOWN:
                defStr  = defStr.Replace("#0", attr.value.ToString());
                haveDef = true;
                break;

            default:
                builder.Append(ConfigMng.Instance.GetAttributeTypeName(attr.tag));
                builder.Append(":").Append(attr.value);
                int upgradeVal = info.GetStrengthValueByTag(attr.tag);
                if (upgradeVal != 0)
                {
                    builder.Append("    [00ff00]+").Append(upgradeVal).Append("[-]");
                }
                if (i < max - 1 || haveAtk || haveDef)
                {
                    builder.Append("\n");
                }
                break;
            }
        }
        int atk = info.GetStrengthValueByTag(ActorPropertyTag.ATK);
        int def = info.GetStrengthValueByTag(ActorPropertyTag.DEF);

        if (haveAtk)
        {
            builder.Append(atkStr);
        }
        if (atk != 0)
        {
            builder.Append("    [00ff00]+").Append(atk).Append("[-]");
        }
        if (haveDef)
        {
            builder.Append(defStr);
        }
        if (def != 0)
        {
            builder.Append("    [00ff00]+").Append(def).Append("[-]");
        }
        return(builder.ToString());
    }
コード例 #11
0
ファイル: EquipmentRefTable.cs プロジェクト: Klanly/tianyu
 public AttributePair(AttributePair _temp)
 {
     this.tag   = _temp.tag;
     this.value = _temp.value;
 }