當前位置: 首頁>>代碼示例>>C#>>正文


C# Block.GetType方法代碼示例

本文整理匯總了C#中Block.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# Block.GetType方法的具體用法?C# Block.GetType怎麽用?C# Block.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Block的用法示例。


在下文中一共展示了Block.GetType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetDrillMiningValidityOfBlocksIfYouBoughtTheRightDrill

 public static bool GetDrillMiningValidityOfBlocksIfYouBoughtTheRightDrill(Drill thisIsTheDrillThatThePlayerHas, Block thisIsTheBlockThatThePlayerIsCurrentlyAttemptingToRemoveFromTheWorldExceptTheyMightNotHaveTheRightDrill)
 {
     foreach (var thisIsOneOfTheBlockOptionsInTheListOfValidBlocksInTheDrill in thisIsTheDrillThatThePlayerHas.mineableBlocks) {
        if (thisIsTheBlockThatThePlayerIsCurrentlyAttemptingToRemoveFromTheWorldExceptTheyMightNotHaveTheRightDrill.GetType() == thisIsOneOfTheBlockOptionsInTheListOfValidBlocksInTheDrill)
        {
            return true;
        }
        }
        return false;
 }
開發者ID:danenespoli,項目名稱:delve,代碼行數:10,代碼來源:Engine.cs

示例2: DirectClicked

        void DirectClicked(ToolStripMenuItem clickeditem, Block blockobject,BlockData bdata,ManyToOneBlockData mtodata)
        {
            BlockData getbd;
            ManyToOneBlockData getmanytoone;
            Block acquireBlock;

            getbd = bdata;
            getmanytoone = mtodata;
            acquireBlock = blockobject;

            //set some defaults.
            if (getmanytoone != null)
            {
                //manyto one block. Should show name of "actual" type.
                Text = getmanytoone.DisplayText;
                ToolTipText = blockobject.GetType().Name + " - " + getmanytoone.DisplayText;
                //we need to draw it speshul.
                Bitmap resultimage = null;
                Graphics resultg = null;
                Block.DrawBlock(blockobject, out resultimage, out resultg);
                Image = resultimage;

            }
            else
            {
                Text = bdata.BlockType.Name;
                ToolTipText = Text;
                Image = bdata.useBlockImage;
            }

            var gotargs = new BlockToolStripButtonBlockSelectedArgs(blockobject, getmanytoone, bdata);
            var copied = BlockSelected;
            if (copied != null) copied(this, gotargs);
            SelectedItem = gotargs;
        }
開發者ID:BCProgramming,項目名稱:BASeBlock,代碼行數:35,代碼來源:BlockToolStripButton.cs

示例3: ValidateDefinition

		protected void ValidateDefinition(string expStr, int expVariations, int expChildCount, Block org)
		{
			var tp = org.GetType().Name;
			var name = tp.Substring(5, 1);
			var rot = tp.Substring(6);
			Block.RotationType rotation = Block.RotationType.None;

			if (!String.IsNullOrEmpty(rot) && !Enum.TryParse<Block.RotationType>(rot, out rotation))
			{
				Assert.Fail("Type '{0}', name does not fit into contract.", tp);
			}

			Assert.AreEqual(name, org.Name, "Name");
			Assert.AreEqual(rotation, org.Rotation, "Rotation");

			Assert.AreEqual(expStr, org.ToString(), "ToString().");
			Assert.AreEqual(4, org.Count, "Count should be 4.");
			Assert.AreEqual(expVariations, org.Variations.Length, "Variations.Length");
			Assert.AreEqual(expChildCount, org.ChildCount, "ChildCount");
		}
開發者ID:Corniel,項目名稱:AIGames.BlockBattle.Kubisme,代碼行數:20,代碼來源:BlockTest.cs


注:本文中的Block.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。