static int getGradeConfigByGrade(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); QualifyingNewConfig obj = (QualifyingNewConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "QualifyingNewConfig"); int arg0 = (int)LuaScriptMgr.GetNumber(L, 2); fogs.proto.config.QualifyingNewConfig o = obj.getGradeConfigByGrade(arg0); LuaScriptMgr.PushObject(L, o); return(1); }
void ReadQualifyingNewData() { string text = ResourceLoadManager.Instance.GetConfigText(name1); if (text == null) { Debug.LogError("LoadConfig failed: " + name1); return; } XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(name1, text); XmlNodeList nodelist = xmlDoc.SelectSingleNode("Data").ChildNodes; foreach (XmlElement xe in nodelist) { if (CommonFunction.IsCommented(xe)) { continue; } QualifyingNewGrade data = new QualifyingNewGrade(); uint value; uint.TryParse(xe.SelectSingleNode("section").InnerText, out value); data.section = value; uint value_score; uint.TryParse(xe.SelectSingleNode("score").InnerText, out value_score); data.score = value_score; // data.section = uint.Parse(xe.SelectSingleNode("section").InnerText); // data.score = uint.Parse(xe.SelectSingleNode("score").InnerText); data.title = xe.SelectSingleNode("title").InnerText; uint star = 0; uint.TryParse(xe.SelectSingleNode("star").InnerText, out star); data.star = star; data.icon = xe.SelectSingleNode("icon").InnerText; data.icon_small = xe.SelectSingleNode("icon_small").InnerText; uint upgrade_score; uint.TryParse(xe.SelectSingleNode("upgrade_score").InnerText, out upgrade_score); data.upgrade_score = upgrade_score; uint value_id; uint.TryParse(xe.SelectSingleNode("award_id").InnerText, out value_id); data.award_id = value_id; // data.award_id = uint.Parse(xe.SelectSingleNode("award_id").InnerText); data.award_icon = xe.SelectSingleNode("award_icon").InnerText; uint value_ai; uint.TryParse(xe.SelectSingleNode("opponentAI").InnerText, out value_ai); data.opponentAI = value_ai; grades.Add(data); maxStarNum[data.section] = data.star; } }
public QualifyingNewGrade GetNextGrade(uint score) { QualifyingNewGrade grade = null; foreach (QualifyingNewGrade g in grades) { grade = g; if (g.score > score) { break; } } return(grade); }
public QualifyingNewGrade GetPrevGrade(uint score) { QualifyingNewGrade grade = null; QualifyingNewGrade prevGrade = null; foreach (QualifyingNewGrade g in grades) { if (g.score > score) { break; } prevGrade = grade; grade = g; } return(prevGrade); }
public QualifyingNewGrade GetGrade(uint score) { QualifyingNewGrade grade = null; foreach (QualifyingNewGrade g in grades) { if (score >= g.score) { grade = g; } else { break; } } return(grade); }
static int _Createfogs_proto_config_QualifyingNewConfig(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { fogs.proto.config.QualifyingNewConfig obj = new fogs.proto.config.QualifyingNewConfig(); LuaScriptMgr.PushObject(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: fogs.proto.config.QualifyingNewConfig.New"); } return(0); }
static int get_title(IntPtr L) { object o = LuaScriptMgr.GetLuaObject(L, 1); fogs.proto.config.QualifyingNewConfig obj = (fogs.proto.config.QualifyingNewConfig)o; if (obj == null) { LuaTypes types = LuaDLL.lua_type(L, 1); if (types == LuaTypes.LUA_TTABLE) { LuaDLL.luaL_error(L, "unknown member name title"); } else { LuaDLL.luaL_error(L, "attempt to index title on a nil value"); } } LuaScriptMgr.Push(L, obj.title); return(1); }
static int set_opponentAI(IntPtr L) { object o = LuaScriptMgr.GetLuaObject(L, 1); fogs.proto.config.QualifyingNewConfig obj = (fogs.proto.config.QualifyingNewConfig)o; if (obj == null) { LuaTypes types = LuaDLL.lua_type(L, 1); if (types == LuaTypes.LUA_TTABLE) { LuaDLL.luaL_error(L, "unknown member name opponentAI"); } else { LuaDLL.luaL_error(L, "attempt to index opponentAI on a nil value"); } } obj.opponentAI = (uint)LuaScriptMgr.GetNumber(L, 3); return(0); }
static int set_icon_small(IntPtr L) { object o = LuaScriptMgr.GetLuaObject(L, 1); fogs.proto.config.QualifyingNewConfig obj = (fogs.proto.config.QualifyingNewConfig)o; if (obj == null) { LuaTypes types = LuaDLL.lua_type(L, 1); if (types == LuaTypes.LUA_TTABLE) { LuaDLL.luaL_error(L, "unknown member name icon_small"); } else { LuaDLL.luaL_error(L, "attempt to index icon_small on a nil value"); } } obj.icon_small = LuaScriptMgr.GetString(L, 3); return(0); }