akadoc/Assets/src/Player.cs

40 lines
802 B
C#

using UnityEngine;
using System.Collections;
public class Player {
public Player(int _charID, int _roleID){
charID = _charID;
roleID = _roleID;
var ct = Rdb.GetTable("characters");
charname = ct.GetValue<string>(charID, "name");
spellID = ct.GetValue<int>(charID, "spell");
hp = ct.GetValue<int>(charID, "hp");
var rt = Rdb.GetTable("roles");
rolename = rt.GetValue<string>(roleID, "name");
ultiID = rt.GetValue<int>(roleID, "ulti");
align = rt.GetValue<string>(roleID, "alignment");
}
public void DebugInfo() {
Debug.Log(charname+" is a "+rolename+" with "+hp.ToString()+" hit points");
}
public int charID;
public int roleID;
public string charname;
public int spellID;
public int hp;
public string rolename;
public int ultiID;
public string align;
}