本文整理汇总了C#中Exp类的典型用法代码示例。如果您正苦于以下问题:C# Exp类的具体用法?C# Exp怎么用?C# Exp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Exp类属于命名空间,在下文中一共展示了Exp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Declare
public void Declare(Accessibility accessibility, String name, Exp value = null)
{
if (dict.ContainsKey(name))
validations.GenericWarning("variable '" + name + "' is already declared",
Void.Instance);
dict.Add(name, new EnvItem(accessibility, value));
}
示例2: ExceptHandler
public ExceptHandler(Exp type, Identifier name, SuiteStatement body, string filename, int start, int end)
: base(filename, start, end)
{
this.type = type;
this.name = name;
this.body = body;
}
示例3: printEnvText
static Void printEnvText(Exp asi)
{
var he = asi as IHasEnv;
if (he != null)
Env.PrintEnv(he.Env);
return new Void();
}
示例4: SwitchStmt
public SwitchStmt(Exp exp, Exp opCase1, IStmt case1, Exp opCase2, IStmt case2, IStmt defaultCase)
{
this.exp = exp;
this.expCase1 = opCase1;
this.case1 = case1;
this.case2 = case2;
this.expCase2 = opCase2;
this.defaultCase = defaultCase;
}
示例5: InitThread
private void InitThread(Time time, Exp action)
{
while (true)
{
Thread.Sleep(GetTimeUntilSleep(time));
action.Invoke();
}
}
示例6: Schedule
public void Schedule(Exp exp, Time time)
{
actions.Add(exp);
Thread t = new Thread(new ThreadStart(() => { InitThread(time, exp); }));
workers.Add(t);
t.Start();
}
示例7: Replace
public object Replace(string name, Exp<object> exp)
{
if (this.Name == name)
{
return exp.Copy();
}
else
{
return Copy();
}
}
示例8: TakeDamage
public void TakeDamage(float amount, Exp exp = null)
{
/* Returns true if the monster was killed with this attack
*/
if (isDead)
return;
damaged = true;
curHealth -= amount;
Debug.Log("Enemy Takes Damage");
Debug.Log(curHealth);
if(curHealth <= 0)
{
Debug.Log("Enemy Destroyed!!!");
Death();
if(exp != null) exp += expVal;
}
}
示例9: ViewKuniInfo
public void ViewKuniInfo(){
string kuniPath = "Prefabs/Map/KuniInfo";
GameObject kuni = Instantiate (Resources.Load (kuniPath)) as GameObject;
kuni.transform.SetParent(GameObject.Find ("Kakejiku").transform);
kuni.transform.localScale = new Vector2 (1, 1);
kuni.name = "kuniInfo";
//Current Kokuryoku
int kuniExp = PlayerPrefs.GetInt ("kuniExp");
kuni.transform.FindChild ("KuniLvValue").GetComponent<Text> ().text = kuniExp.ToString ();
//Exp for Next Lv
int nowLv = PlayerPrefs.GetInt ("kuniLv");
Exp exp = new Exp ();
int totalExp = exp.getKuniExpforNextLv (nowLv);
int diff = totalExp - kuniExp;
kuni.transform.FindChild ("KuniNextLvValue").GetComponent<Text> ().text = diff.ToString ();
//Now Kuni Qty
string clearedKuni = PlayerPrefs.GetString ("clearedKuni");
if (clearedKuni != null && clearedKuni != "") {
if (clearedKuni.Contains (",")) {
char[] delimiterChars = {','};
string[] clearedKuniList = clearedKuni.Split (delimiterChars);
kuni.transform.FindChild ("ShiroQtyValue").GetComponent<Text> ().text = clearedKuniList.Length.ToString ();
} else {
kuni.transform.FindChild ("ShiroQtyValue").GetComponent<Text> ().text = "1";
}
} else {
kuni.transform.FindChild ("ShiroQtyValue").GetComponent<Text> ().text = "0";
}
//Syutujin Limit
int jinkeiLimit = PlayerPrefs.GetInt ("jinkeiLimit");
kuni.transform.FindChild ("SyutsujinQtyValue").GetComponent<Text> ().text = jinkeiLimit.ToString ();
//Stock Limit
int stockLimit = PlayerPrefs.GetInt ("stockLimit");
int myBusyoQty = PlayerPrefs.GetInt ("myBusyoQty");
string value = myBusyoQty.ToString () + "/" + stockLimit.ToString ();
kuni.transform.FindChild ("TouyouQtyValue").GetComponent<Text> ().text = value;
}
示例10: CheckInt
void CheckInt(Exp e)
{
if(e.ExpType != typeof(int)){
if (e is VarExp && e.ExpType == typeof(void)){ //Param Variable. Type unknown. Assume first occurence
e.ExpType = typeof(int);
CurrentFuncDef.Add(((VarExp)e).Name, typeof(int));
}
else if (e is DoVarExp && e.ExpType == typeof(void)){ //Do Variable. Type unknown. Assume first occurence
e.ExpType = typeof(int);
DoVars.Add(((DoVarExp)e).Pos, typeof(int));
}
else if (e is CallExp && e.ExpType == typeof(void)){ //Recursive function call. Assume first occurence
e.ExpType = typeof(int);
}
else if (!(e is CarExp)){ //CarExp will be coerceto int
Console.WriteLine("Int expected");
success = false;
}
}
}
示例11: arglist
//arglist: (argument ',')* (argument [',']
// |'*' test (',' argument)* [',' '**' test]
// |'**' test)
public Application arglist(Exp core, int posStart)
{
var args = new List<Argument>();
var keywords = new List<Argument>();
Exp stargs = null;
Exp kwargs = null;
Token token;
if (Peek(TokenType.RPAREN, out token))
return new Application(core, args, keywords, stargs, kwargs, filename, core.Start, token.End);
for (;;)
{
if (PeekAndDiscard(TokenType.OP_STAR))
{
if (stargs != null)
throw new NotSupportedException("More than one stargs.");
stargs = test();
}
else if (PeekAndDiscard(TokenType.OP_STARSTAR))
{
if (kwargs != null)
throw new NotSupportedException("More than one kwargs.");
kwargs = test();
}
else
{
var arg = argument();
if (arg != null)
args.Add(arg);
}
if (!PeekAndDiscard(TokenType.COMMA, out token))
break;
if (Peek(TokenType.RPAREN, out token))
break;
}
return new Application(core, args, keywords, stargs, kwargs, filename, posStart, token.End);
}
示例12: trailer
//trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
public Exp trailer(Exp core)
{
Token tok;
switch (lexer.Peek().Type)
{
case TokenType.LPAREN:
tok = lexer.Get();
var args = arglist(core, tok.Start);
Expect(TokenType.RPAREN);
return args;
case TokenType.LBRACKET:
lexer.Get();
var subs = subscriptlist();
tok = Expect(TokenType.RBRACKET);
return new ArrayRef(core, subs, filename, core.Start, tok.End);
case TokenType.DOT:
lexer.Get();
tok = Expect(TokenType.ID);
var id = new Identifier((string) tok.Value, filename, core.Start, tok.End);
return new AttributeAccess(core, id, filename, core.Start, tok.End);
default: throw new InvalidOperationException();
}
}
示例13: GenerateBaseClassName
private string GenerateBaseClassName(Exp exp)
{
return exp.ToString();
}
示例14: GenerateAssert
private void GenerateAssert(Exp test)
{
gen.SideEffect(
gen.Appl(
new CodeMethodReferenceExpression(
new CodeTypeReferenceExpression("Debug"),
"Assert"),
test.Accept(xlat)));
gen.EnsureImport("System.Diagnostics");
}
示例15: IfStmt
public IfStmt(Exp e, IStmt then, IStmt otherwise)
{
this.exp = e;
this.thenStmt = then;
this.elseStmt = otherwise;
}