本文整理汇总了C#中CSAngband.Parser.getuint方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.getuint方法的具体用法?C# Parser.getuint怎么用?C# Parser.getuint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSAngband.Parser
的用法示例。
在下文中一共展示了Parser.getuint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parse_s_n
/* Parsing functions for spell.txt */
public static Parser.Error parse_s_n(Parser p)
{
Spell s = new Spell();
s.next = p.priv as Spell;
s.sidx = p.getuint("index");
s.name = p.getstr("name");
p.priv = s;
return Parser.Error.NONE;
}
示例2: parse_flavor_n
/* Parsing functions for flavor.txt */
public static Parser.Error parse_flavor_n(Parser p)
{
Flavor h = p.priv as Flavor;
Flavor f = new Flavor();
f.next = h;
f.fidx = p.getuint("index");
f.tval = (byte)TVal.find_idx(p.getsym("tval"));
/* Misc.assert(f.tval); */
if (p.hasval("sval"))
f.sval = (byte)SVal.lookup_sval(f.tval, p.getsym("sval"));
else
f.sval = SVal.SV_UNKNOWN;
p.priv = f;
return Parser.Error.NONE;
}
示例3: parse_s_i
public static Parser.Error parse_s_i(Parser p)
{
Spell s = p.priv as Spell;
if (s == null)
return Parser.Error.MISSING_RECORD_HEADER;
s.tval = (byte)p.getuint("tval");
s.sval = (byte)p.getuint("sval");
s.snum = (byte)p.getuint("snum");
/* XXX elly: postprocess instead? */
s.realm = (byte)(s.tval - TVal.TV_MAGIC_BOOK);
s.spell_index = (byte)(s.sidx - (s.realm * Misc.PY_MAX_SPELLS));
return Parser.Error.NONE;
}
示例4: parse_i
static Parser.Error parse_i(Parser p)
{
Store s = p.priv as Store;
uint slots = p.getuint("slots");
int tval = TVal.find_idx(p.getsym("tval"));
int sval = SVal.lookup_sval(tval, p.getsym("sval"));
Object_Kind kind = Object_Kind.lookup_kind(tval, sval);
if(kind == null)
return Parser.Error.UNRECOGNISED_SVAL;
if(s.table_num + slots > s.table_size)
return Parser.Error.TOO_MANY_ENTRIES;
while(slots-- != 0) {
s.table[s.table_num++] = kind;
}
/* XXX: get rid of this table_size/table_num/indexing thing. It's
* stupid. Dynamically allocate. */
return Parser.Error.NONE;
}
示例5: parse_own_s
static Parser.Error parse_own_s(Parser p)
{
owner_parser_state s = p.priv as owner_parser_state;
uint maxcost = p.getuint("maxcost");
string name = p.getstr("name");
Owner o;
if (s.cur == null)
return Parser.Error.MISSING_RECORD_HEADER;
o = new Owner();
o.oidx = (s.cur.owners != null ? s.cur.owners.oidx + 1 : 0);
o.next = s.cur.owners;
o.name = name;
o.max_cost = (int)maxcost;
s.cur.owners = o;
return Parser.Error.NONE;
}
示例6: parse_c_b
public static Parser.Error parse_c_b(Parser p)
{
Player_Class c = p.priv as Player_Class;
uint spell;
if (c == null)
return Parser.Error.MISSING_RECORD_HEADER;
spell = p.getuint("spell");
if (spell >= Misc.PY_MAX_SPELLS)
return Parser.Error.OUT_OF_BOUNDS;
c.spells.info[spell] = new Magic_Type();
c.spells.info[spell].slevel = (byte)p.getint("level");
c.spells.info[spell].smana = (byte)p.getint("mana");
c.spells.info[spell].sfail = (byte)p.getint("fail");
c.spells.info[spell].sexp = (byte)p.getint("exp");
return Parser.Error.NONE;
}
示例7: parse_c_m
public static Parser.Error parse_c_m(Parser p)
{
Player_Class c = p.priv as Player_Class;
if (c == null)
return Parser.Error.MISSING_RECORD_HEADER;
c.spell_book = (byte)p.getuint("book");
c.spell_stat = (ushort)p.getuint("stat");
c.spell_first = (ushort)p.getuint("first");
c.spell_weight = (ushort)p.getuint("weight");
return Parser.Error.NONE;
}
示例8: parse_pit_n
/*
* Initialize monster pits
*/
public static Parser.Error parse_pit_n(Parser p)
{
Pit_Profile h = p.priv as Pit_Profile;
Pit_Profile pit = new Pit_Profile();
pit.next = h;
pit.pit_idx = (int)p.getuint("index");
pit.name = p.getstr("name");
p.priv = pit;
return Parser.Error.NONE;
}
示例9: parse_pit_o
public static Parser.Error parse_pit_o(Parser p)
{
Pit_Profile pit = p.priv as Pit_Profile;
if (pit == null)
return Parser.Error.MISSING_RECORD_HEADER;
pit.obj_rarity = (int)p.getuint("obj_rarity");
return Parser.Error.NONE;
}
示例10: parse_h_n
/* Parsing functions for p_hist.txt */
public static Parser.Error parse_h_n(Parser p)
{
History_Chart oc = p.priv as History_Chart;
History_Chart c;
History_Entry e = new History_Entry();
uint idx = p.getuint("chart");
if ((c = findchart(oc, idx)) == null) {
c = new History_Chart();
c.next = oc;
c.idx = idx;
p.priv = c;
}
e.isucc = p.getint("next");
e.roll = p.getint("roll");
e.bonus = p.getint("bonus");
e.next = c.entries;
c.entries = e;
return Parser.Error.NONE;
}
示例11: parse_mp_n
/* Initialise monster pain messages */
public static Parser.Error parse_mp_n(Parser p)
{
Monster_Pain h = p.priv as Monster_Pain;
Monster_Pain mp = new Monster_Pain();
mp.Next = h;
mp.pain_idx = (int)p.getuint("index");
p.priv = mp;
return Parser.Error.NONE;
}
示例12: parse_f_p
public static Parser.Error parse_f_p(Parser p)
{
uint priority = p.getuint("priority");
Feature f = p.priv as Feature;
if (f == null)
return Parser.Error.MISSING_RECORD_HEADER;
f.priority = (byte)priority;
return Parser.Error.NONE;
}
示例13: parse_f_n
/* Parsing functions for terrain.txt */
public static Parser.Error parse_f_n(Parser p)
{
int idx = (int)p.getuint("index");
string name = p.getstr("name");
Feature h = (Feature)p.priv;
Feature f = new Feature();
f.next = h;
f.fidx = idx;
f.mimic = (byte)idx;
f.name = name;
p.priv = f;
return Parser.Error.NONE;
}
示例14: parse_f_m
public static Parser.Error parse_f_m(Parser p)
{
uint idx = p.getuint("index");
Feature f = p.priv as Feature;
if (f == null)
return Parser.Error.MISSING_RECORD_HEADER;
f.mimic = (byte)idx;
return Parser.Error.NONE;
}
示例15: parse_v_n
/* Parsing functions for vault.txt */
public static Parser.Error parse_v_n(Parser p)
{
Vault h = p.priv as Vault;
Vault v = new Vault();
v.vidx = p.getuint("index");
v.name = p.getstr("name");
v.next = h;
p.priv = v;
return Parser.Error.NONE;
}