• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Exp类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Exp的典型用法代码示例。如果您正苦于以下问题:C# Exp类的具体用法?C# Exp怎么用?C# Exp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Exp类属于命名空间,在下文中一共展示了Exp类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
 }
开发者ID:michal-minich,项目名称:Efekt-CS,代码行数:7,代码来源:Env.cs


示例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;
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:7,代码来源:ExceptHandler.cs


示例3: printEnvText

 static Void printEnvText(Exp asi)
 {
     var he = asi as IHasEnv;
     if (he != null)
         Env.PrintEnv(he.Env);
     return new Void();
 }
开发者ID:michal-minich,项目名称:Efekt-CS,代码行数:7,代码来源:Builtins.cs


示例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;
 }
开发者ID:victorursan,项目名称:ToyLanguage_NET,代码行数:9,代码来源:SwitchStmt.cs


示例5: InitThread

        private void InitThread(Time time, Exp action)
        {
            while (true)
            {
                Thread.Sleep(GetTimeUntilSleep(time));

                action.Invoke();
            }
        }
开发者ID:stephanspacov,项目名称:Web.Generics,代码行数:9,代码来源:Scheduler.cs


示例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();
        }
开发者ID:stephanspacov,项目名称:Web.Generics,代码行数:10,代码来源:Scheduler.cs


示例7: Replace

 public object Replace(string name, Exp<object> exp)
 {
     if (this.Name == name)
     {
         return exp.Copy();
     }
     else
     {
         return Copy();
     }
 }
开发者ID:IMaylatov,项目名称:Interpretator,代码行数:11,代码来源:VariableExp.cs


示例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;
		}
	}
开发者ID:sowrd299,项目名称:GlowPillow,代码行数:17,代码来源:MinionsStats.cs


示例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;
	}
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:43,代码来源:IconClick.cs


示例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;
	    }
	}

    }
开发者ID:ArildF,项目名称:masters,代码行数:21,代码来源:typecheck.cs


示例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);
        }
开发者ID:uxmal,项目名称:pytocs,代码行数:40,代码来源:Parser.cs


示例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();
     }
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:24,代码来源:Parser.cs


示例13: GenerateBaseClassName

 private string GenerateBaseClassName(Exp exp)
 {
     return exp.ToString();
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:4,代码来源:StatementTranslator.cs


示例14: GenerateAssert

 private void GenerateAssert(Exp test)
 {
     gen.SideEffect(
         gen.Appl(
             new CodeMethodReferenceExpression(
                 new CodeTypeReferenceExpression("Debug"),
                 "Assert"),
             test.Accept(xlat)));
     gen.EnsureImport("System.Diagnostics");
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:10,代码来源:StatementTranslator.cs


示例15: IfStmt

 public IfStmt(Exp e, IStmt then, IStmt otherwise)
 {
     this.exp = e;
     this.thenStmt = then;
     this.elseStmt = otherwise;
 }
开发者ID:danielacraciun,项目名称:TL_CSharp,代码行数:6,代码来源:IfStmt.cs


示例16: KeywordArgument

 public KeywordArgument(Exp t, string filename, int start, int end)
     : base(t, filename, start, end)
 {
 }
开发者ID:uxmal,项目名称:pytocs,代码行数:4,代码来源:Argument.cs


示例17: OnClick

	public void OnClick(){

		busyoName = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyoName;
		busyoId = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyo;

		commonPopup ();

		if(buttonName == "kanjyo"){
			GameObject.Find ("popText").GetComponent<Text> ().text ="感状授与";

			//Busyo View
			string path = "Prefabs/Player/Unit/" + busyoId;
			GameObject Busyo = Instantiate (Resources.Load (path)) as GameObject;			
			Busyo.transform.SetParent (GameObject.Find ("board(Clone)").transform);
			Busyo.transform.localScale = new Vector2 (3, 3);
			Busyo.GetComponent<DragHandler>().enabled = false;
			RectTransform busyo_transform = Busyo.GetComponent<RectTransform>();
			busyo_transform.anchoredPosition = new Vector3(300,350,0);
			busyo_transform.sizeDelta = new Vector2( 100, 100);

			//Text Modification
			GameObject text = Busyo.transform.FindChild ("Text").gameObject;
			text.GetComponent<Text> ().color = new Color(255,255,255,255);
			RectTransform text_transform = text.GetComponent<RectTransform>();
			text_transform.anchoredPosition = new Vector3 (-70,30,0);
			text_transform.sizeDelta = new Vector2( 630, 120);
			text.transform.localScale = new Vector2 (0.2f,0.2f);

			//Rank Text Modification
			GameObject rank = Busyo.transform.FindChild ("Rank").gameObject;
			RectTransform rank_transform = rank.GetComponent<RectTransform>();
			rank_transform.anchoredPosition = new Vector3 (20,-50,0);
			rank_transform.sizeDelta = new Vector2( 200, 200);
			rank.GetComponent<Text>().fontSize = 200;

			//Common for Kanjyo
			string kanjyoPath = "Prefabs/Busyo/Kanjyo";
			GameObject kanjyo = Instantiate (Resources.Load (kanjyoPath)) as GameObject;
			kanjyo.transform.SetParent (GameObject.Find ("board(Clone)").transform);
			kanjyo.transform.localScale = new Vector2 (1, 1);
			RectTransform kanjyo_transform = kanjyo.GetComponent<RectTransform>();
			kanjyo_transform.anchoredPosition = new Vector3(0,0,0);

			//Busyo Lv 
			GameObject.Find ("PopLvValue").GetComponent<Text>().text = pa_lv.ToString();
			
			//Exp Status Bar
			Exp exp = new Exp();


			GameObject expSlider = GameObject.Find ("ExpSlider");
			int nextExp =exp.getDifExpforNextLv(pa_lv);
			string tempExp = "exp" + busyoId;
			int nowExp = PlayerPrefs.GetInt(tempExp);
			int startExp = nowExp - exp.getExpforNextLv(pa_lv-1);


			expSlider.GetComponent<Slider>().value = startExp;
			expSlider.GetComponent<Slider>().maxValue = nextExp;

			GameObject.Find ("CurrentExpValue").GetComponent<Text>().text = startExp.ToString();
			GameObject.Find ("NextLvExpValue").GetComponent<Text>().text = nextExp.ToString();


			Item item =new Item();

			//Low kanjyo fields
			string kanjyoItemPath = "Prefabs/Item/Kanjyo/Kanjyo";
			GameObject lowKanjyoItem = Instantiate (Resources.Load (kanjyoItemPath)) as GameObject;
			lowKanjyoItem.transform.SetParent(GameObject.Find ("KakyuKanjyo").transform);
			lowKanjyoItem.transform.localScale = new Vector2 (0.8f, 0.8f);
			RectTransform lowKanjyoTransform = lowKanjyoItem.GetComponent<RectTransform> ();
			lowKanjyoTransform.anchoredPosition = new Vector3 (-210, 125, 0);
			lowKanjyoTransform.sizeDelta = new Vector2 (100, 100);
			RectTransform lowKanjyoRank = lowKanjyoItem.transform.FindChild("KanjyoRank").GetComponent<RectTransform>();
			lowKanjyoRank.anchoredPosition = new Vector3(-30,30,0);
			RectTransform lowKanjyoRect = lowKanjyoItem.transform.FindChild("Kanjyo").GetComponent<RectTransform>();
			lowKanjyoRect.sizeDelta = new Vector2 (100, 100);
			Color lowColor = new Color (86f / 255f, 87f / 255f, 255f / 255f, 255f / 255f);
			lowKanjyoItem.GetComponent<Image>().color = lowColor;
			lowKanjyoItem.transform.FindChild("KanjyoRank").GetComponent<Text>().text = "下";
			lowKanjyoItem.name = "Kanjyo1";

			//Item Effect
			int effectForLow =item.getEffect(lowKanjyoItem.name);
			GameObject.Find ("KakyuKanjyoExpValue").GetComponent<Text>().text = effectForLow.ToString();

			//Middle kanjyo fields
			GameObject midKanjyoItem = Instantiate (Resources.Load (kanjyoItemPath)) as GameObject;
			midKanjyoItem.transform.SetParent(GameObject.Find ("CyukyuKanjyo").transform);
			midKanjyoItem.transform.localScale = new Vector2 (0.8f, 0.8f);
			RectTransform midKanjyoTransform = midKanjyoItem.GetComponent<RectTransform> ();
			midKanjyoTransform.anchoredPosition = new Vector3 (-210, 125, 0);
			midKanjyoTransform.sizeDelta = new Vector2 (100, 100);
			RectTransform midKanjyoRank = midKanjyoItem.transform.FindChild("KanjyoRank").GetComponent<RectTransform>();
			midKanjyoRank.anchoredPosition = new Vector3(-30,30,0);
			RectTransform midKanjyoRect = midKanjyoItem.transform.FindChild("Kanjyo").GetComponent<RectTransform>();
			midKanjyoRect.sizeDelta = new Vector2 (100, 100);
			Color midColor = new Color (236f / 255f, 93f / 255f, 93f / 255f, 255f / 255f);
			midKanjyoItem.GetComponent<Image>().color = midColor;
//.........这里部分代码省略.........
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:101,代码来源:BusyoStatusButton.cs


示例18: createBusyoStatusView

    public void createBusyoStatusView(string busyoId)
    {
        int lv = PlayerPrefs.GetInt (busyoId);
        StatusGet sts = new StatusGet ();
        int hp = sts.getHp (int.Parse (busyoId), lv);
        int atk = sts.getAtk (int.Parse (busyoId), lv);
        int dfc = sts.getDfc (int.Parse (busyoId), lv);
        int spd = sts.getSpd (int.Parse (busyoId), lv);

        int adjHp = hp * 100;
        int adjAtk = atk * 10;
        int adjDfc = dfc * 10;

        GameObject.Find ("LvValue").GetComponent<Text> ().text = lv.ToString ();
        GameObject.Find ("TosotsuValue").GetComponent<Text> ().text = adjHp.ToString ();
        GameObject.Find ("BuyuuValue").GetComponent<Text> ().text = adjAtk.ToString ();
        GameObject.Find ("ChiryakuValue").GetComponent<Text> ().text = adjDfc.ToString ();
        GameObject.Find ("SpeedValue").GetComponent<Text> ().text = spd.ToString ();

        //Exp
        string expId = "exp" + busyoId.ToString ();
        string expString = "";
        int nowExp = PlayerPrefs.GetInt(expId);
        Exp exp = new Exp ();
        int requiredExp= exp.getExpforNextLv(lv);

        expString = nowExp + "/" + requiredExp;
        GameObject.Find ("ExpValue").GetComponent<Text> ().text = expString;

        //Kahou status
        KahouStatusGet kahouSts = new KahouStatusGet ();
        string[] KahouStatusArray =kahouSts.getKahouForStatus (busyoId,adjHp,adjAtk,adjDfc,spd);
        int totalBusyoHp =0;
        for(int i=0;i<KahouStatusArray.Length;i++){
            string status = KahouStatusArray[i];

            if(i==0){
                //Attack
                GameObject.Find ("KahouAtkValue").GetComponent<Text>().text = "+" + status;

            }else if(i==1){
                //HP
                GameObject.Find ("KahouHpValue").GetComponent<Text>().text = "+" + status;
                totalBusyoHp = adjHp + int.Parse(status);
            }else if(i==2){
                //DFC
                GameObject.Find ("KahouDfcValue").GetComponent<Text>().text = "+" + status;

            }else if(i==3){
                //SPD
                GameObject.Find ("KahouSpdValue").GetComponent<Text>().text = "+" + status;
            }
        }

        //Butai Status
        string heiId = "hei" + busyoId.ToString ();
        string chParam = PlayerPrefs.GetString (heiId, "0");

        char[] delimiterChars = {':'};
        string[] ch_list = chParam.Split (delimiterChars);

        string ch_type = ch_list [0];
        int ch_num = int.Parse (ch_list [1]);
        int ch_lv = int.Parse (ch_list [2]);
        float ch_status = float.Parse (ch_list [3]);

        string heisyu = "";
        if (ch_type == "KB") {
            heisyu = "騎馬隊";
        } else if (ch_type == "YR") {
            heisyu = "槍隊";
        } else if (ch_type == "TP") {
            heisyu = "鉄砲隊";
        } else if (ch_type == "YM") {
            heisyu = "弓隊";
        }
        GameObject.Find ("ChildNameValue").GetComponent<Text> ().text = heisyu;
        GameObject.Find ("ChildQtyValue").GetComponent<Text> ().text = ch_num.ToString ();
        GameObject.Find ("ChildLvValue").GetComponent<Text> ().text = ch_lv.ToString ();

        //Jyosyu Handling
        JyosyuHeiryoku jyosyuHei = new JyosyuHeiryoku ();
        float addHei = (float)jyosyuHei.GetJyosyuHeiryoku (busyoId);
        float hei = ch_status * 10;
        string heiText = hei.ToString() + "<size=150><Color=#35D74BFF>+" + addHei + "</Color></size>";
        GameObject.Find ("ChildHeiryokuValue").GetComponent<Text> ().text = heiText;

        float chAtkDfc = ch_status + totalBusyoHp / 200;
        string chAtkDfcString = chAtkDfc.ToString () + "/" + chAtkDfc.ToString ();
        GameObject.Find ("ChildStatusValue").GetComponent<Text> ().text = chAtkDfcString;

        //Child Image
        foreach (Transform n in GameObject.Find ("Img").transform) {
            GameObject.Destroy (n.gameObject);
        }
        string chPath = "Prefabs/Player/Unit/" + ch_type;
        GameObject chObj = Instantiate (Resources.Load (chPath)) as GameObject;
        chObj.transform.SetParent(GameObject.Find ("Img").transform);
        RectTransform chTransform = chObj.GetComponent<RectTransform> ();
        chTransform.anchoredPosition = new Vector3 (-200, -50, 0);
//.........这里部分代码省略.........
开发者ID:zeimoter,项目名称:zeimoter,代码行数:101,代码来源:RonkouScene.cs


示例19: IfStmt

 public IfStmt(Exp e, IStmt t, IStmt el)
 {
     exp = e;
     thenS = t;
     elseS = el;
 }
开发者ID:victorursan,项目名称:ToyLanguage_NET,代码行数:6,代码来源:IfStmt.cs


示例20: LogicExp

 public LogicExp(Exp e1, String cmp)
 {
     this.e1 = e1;
     this.e2 = new ConstExp(0);
     this.cmp = cmp;
 }
开发者ID:danielacraciun,项目名称:TL_CSharp,代码行数:6,代码来源:LogicExp.cs



注:本文中的Exp类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ExpandedNodeId类代码示例发布时间:2022-05-24
下一篇:
C# Photon.Hashtable类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap