akadoc/Assets/src/Player.cs

40 lines
802 B
C#
Raw Normal View History

2015-03-04 16:09:45 +00:00
using UnityEngine;
using System.Collections;
public class Player {
2015-03-04 16:41:51 +00:00
public Player(int _charID, int _roleID){
2015-03-04 16:09:45 +00:00
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");
}
2015-03-04 16:41:51 +00:00
public void DebugInfo() {
2015-03-04 16:09:45 +00:00
Debug.Log(charname+" is a "+rolename+" with "+hp.ToString()+" hit points");
}
2015-03-04 16:41:51 +00:00
public int charID;
public int roleID;
2015-03-04 16:09:45 +00:00
2015-03-04 16:41:51 +00:00
public string charname;
public int spellID;
public int hp;
public string rolename;
public int ultiID;
public string align;
2015-03-04 16:09:45 +00:00
}