本文整理汇总了C#中CSAngband.Parser.getint方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.getint方法的具体用法?C# Parser.getint怎么用?C# Parser.getint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSAngband.Parser
的用法示例。
在下文中一共展示了Parser.getint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parse_e_x
public static Parser.Error parse_e_x(Parser p)
{
int rating = p.getint("rating");
int xtra = p.getint("xtra");
Ego_Item e = p.priv as Ego_Item;
if (e == null)
return Parser.Error.MISSING_RECORD_HEADER;
e.rating = (byte)rating;
e.xtra = (byte)xtra;
return Parser.Error.NONE;
}
示例2: 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;
}
示例3: parse_c_i
public static Parser.Error parse_c_i(Parser p)
{
Player_Class c = p.priv as Player_Class;
if (c == null)
return Parser.Error.MISSING_RECORD_HEADER;
c.c_mhp = (short)p.getint("mhp");
c.c_exp = (short)p.getint("exp");
c.sense_base = (uint)p.getint("sense-base");
c.sense_div = (ushort)p.getint("sense-div");
return Parser.Error.NONE;
}
示例4: parse_a_n
/* Parsing functions for artifact.txt */
public static Parser.Error parse_a_n(Parser p)
{
Bitflag f = new Bitflag(Object_Flag.SIZE);
int idx = p.getint("index");
string name = p.getstr("name");
Artifact h = p.priv as Artifact;
Artifact a = new Artifact();
a.Next = h;
p.priv = a;
a.aidx = (byte)idx;
a.Name = name;
/* Ignore all elements */
Object_Flag.create_mask(f, false, Object_Flag.object_flag_type.IGNORE);
a.flags.union(f);
return Parser.Error.NONE;
}
示例5: parse_a_w
public static Parser.Error parse_a_w(Parser p)
{
Artifact a = p.priv as Artifact;
Misc.assert(a != null);
a.level = (byte)p.getint("level");
a.rarity = (byte)p.getint("rarity");
a.weight = (byte)p.getint("weight");
a.cost = p.getint("cost");
return Parser.Error.NONE;
}
示例6: parse_v_x
public static Parser.Error parse_v_x(Parser p)
{
Vault v = p.priv as Vault;
if (v == null)
return Parser.Error.MISSING_RECORD_HEADER;
v.typ = (byte)p.getuint("type");
v.rat = (byte)p.getint("rating");
v.hgt = (byte)p.getuint("height");
v.wid = (byte)p.getuint("width");
/* XXX: huh? These checks were in the original code and I have no idea
* why. */
if (v.typ == 6 && (v.wid > 33 || v.hgt > 22))
return Parser.Error.VAULT_TOO_BIG;
if (v.typ == 7 && (v.wid > 66 || v.hgt > 44))
return Parser.Error.VAULT_TOO_BIG;
return Parser.Error.NONE;
}
示例7: parse_a_a
public static Parser.Error parse_a_a(Parser p)
{
Artifact a = p.priv as Artifact;
string tmp = p.getstr("minmax");
int amin, amax;
Misc.assert(a != null);
a.alloc_prob = (byte)p.getint("common");
string[] tokens = tmp.Split(new string[] { " to " }, StringSplitOptions.RemoveEmptyEntries);
if(tokens.Length != 2)
return Parser.Error.GENERIC;
if(!int.TryParse(tokens[0], out amin) || !int.TryParse(tokens[1], out amax))
return Parser.Error.GENERIC;
if (amin > 255 || amax > 255 || amin < 0 || amax < 0)
return Parser.Error.OUT_OF_BOUNDS;
a.alloc_min = (byte)amin;
a.alloc_max = (byte)amax;
return Parser.Error.NONE;
}
示例8: parse_k_i
public static Parser.Error parse_k_i(Parser p)
{
Object_Kind k = p.priv as Object_Kind;
Misc.assert(k != null);
int tval = TVal.find_idx(p.getsym("tval"));
if (tval < 0)
return Parser.Error.UNRECOGNISED_TVAL;
k.tval = (byte)tval;
k.sval = (byte)p.getint("sval");
k.Base = Misc.kb_info[k.tval];
return Parser.Error.NONE;
}
示例9: parse_k_m
public static Parser.Error parse_k_m(Parser p)
{
Object_Kind k = p.priv as Object_Kind;
Misc.assert(k != null);
k.gen_mult_prob = (byte)p.getint("prob");
k.stack_size = (random_value)p.getrand("stack");
return Parser.Error.NONE;
}
示例10: parse_kb_d
public static Parser.Error parse_kb_d(Parser p)
{
string label;
int value;
kb_parsedata d = p.priv as kb_parsedata;
Misc.assert(d != null);
label = p.getsym("label");
value = p.getint("value");
if (label == "B")
d.defaults.break_perc = value;
else
return Parser.Error.UNDEFINED_DIRECTIVE;
return Parser.Error.NONE;
}
示例11: parse_k_a
public static Parser.Error parse_k_a(Parser p)
{
Object_Kind k = p.priv as Object_Kind;
string tmp = p.getstr("minmax");
Misc.assert(k != null);
k.alloc_prob = (byte)p.getint("common");
int amin, amax;
string[] tokens = tmp.Split(new string[] { " to " }, StringSplitOptions.RemoveEmptyEntries);
if(tokens.Length != 2)
return Parser.Error.GENERIC;
if(!int.TryParse(tokens[0], out amin) || !int.TryParse(tokens[1], out amax))
return Parser.Error.GENERIC;
k.alloc_min = (byte)amin;
k.alloc_max = (byte)amax;
return Parser.Error.NONE;
}
示例12: parse_kb_b
public static Parser.Error parse_kb_b(Parser p)
{
Object.Object_Base kb;
kb_parsedata d = p.priv as kb_parsedata;
Misc.assert(d != null);
kb = d.kb;
Misc.assert(kb != null);
kb.break_perc = p.getint("breakage");
return Parser.Error.NONE;
}
示例13: 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;
}
示例14: parse_f_x
public static Parser.Error parse_f_x(Parser p)
{
Feature f = p.priv as Feature;
if (f == null)
return Parser.Error.MISSING_RECORD_HEADER;
f.locked = (byte)p.getint("locked");
f.jammed = (byte)p.getint("jammed");
f.shopnum = (byte)p.getint("shopnum");
f.dig = (byte)p.getint("dig");
return Parser.Error.NONE;
}
示例15: parse_r_i
public static Parser.Error parse_r_i(Parser p)
{
Monster_Race r = p.priv as Monster_Race;
if (r == null)
return Parser.Error.MISSING_RECORD_HEADER;
r.speed = (byte)p.getint("speed");
r.avg_hp = (ushort)p.getint("hp");
r.aaf = (byte)p.getint("aaf");
r.ac = (short)p.getint("ac");
r.sleep = (short)p.getint("sleep");
return Parser.Error.NONE;
}