Chủ Nhật, 2 tháng 2, 2014

Project RPG BÀI 10B. DỌN DẸP FILE ATTRIBUTE





Chuỗi bài viết dọn dẹp nhà cửa vì lo ăn tết nên post muộn :D


Double click vào file C# Attribute và xóa tất cả đi, chèn lại đoạn code sau vào:

 /// <summary>
/// This is the class for all of the chacracter attributes in-game
/// </summary>
public class Attribute : BaseStat {
    new public const int STARTING_EXP_COST = 50;    //this is the starting cost for all of the attributes
                  
    private string _name;                            //this is the name of the attribute

    /// <summary>
    /// Initializes a new instance of the <see cref="Attribute"/> class.
    /// </summary>
    public Attribute(){
        _name = "";                                  
        ExpToLevel = STARTING_EXP_COST;      
        LevelModifier = 1.05f;
    }

    /// <summary>
    /// Gets or sets the _name.
    /// </summary>
    /// <value>The name.</value>
    public string Name{
        get{return _name;}
        set{_name = value;}
    }
}

/// <summary>
/// A list of all attributes that we will have in-game for chacracters
/// </summary>
public enum AttributeName{
    Might,
    Constituion,
    Nimbleness,
    Speed,
    Concentration,
    Willpower,
    Charisma
}

Không có nhận xét nào:

Đăng nhận xét