예제 #1
0
    /// <summary>
    /// Return the number of mark convert into the <param name="characteristic"/>
    /// </summary>
    /// <param name="characteristic">The characteristic.</param>
    /// TODO : rename method
    /// <returns></returns>
    protected int ValueOfCharacteristic(ECharacteristic characteristic)
    {
        var value = 0;

        if (Characteristics.ContainsKey(characteristic))
        {
            value = Characteristics[characteristic];
        }

        return(value);
    }
예제 #2
0
    /// <summary>
    /// Convert mark from Item into characteristic for this Item.
    /// </summary>
    /// <param name="characteristic"></param>
    /// <param name="mark"></param>
    protected void SetCharacteristic(ECharacteristic characteristic, int mark)
    {
        if (mark > RestantMark)
        {
            return;
        }

        if (!Characteristics.ContainsKey(characteristic))
        {
            Characteristics.Add(characteristic, mark);
        }
        else
        {
            Characteristics[characteristic] += mark;
        }
    }