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

C# Check类代码示例

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

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



Check类属于命名空间,在下文中一共展示了Check类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ClosestPlayer

		public static Player ClosestPlayer(Level lvl, Check C) {
			if (!lvl.ai) return null;
			
			int closestDist = 75;
			Player closetPlayer = null;
			ushort x, y, z;
			lvl.IntToPos(C.b, out x, out y, out z);
			
			Player.players.ForEach(
				delegate(Player p)
				{
					if (p.level == lvl && !p.invincible) {
						int curDist = Math.Abs((p.pos[0] / 32) - x) +
							Math.Abs((p.pos[1] / 32) - y) +
							Math.Abs((p.pos[2] / 32) - z);
						
						if (curDist < closestDist) {
							closestDist = curDist;
							closetPlayer = p;
						}
					}
				}
			);
			return closetPlayer;
		}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:25,代码来源:AIPhysics.cs


示例2: newCheck

 internal static ChequeView newCheck()
 {
     Check c = new Check();
     ChequeView cv = new ChequeView(c);
     new DAOs.CheckDAO(cv.db).insertOnSubmit(c);
     return cv;
 }
开发者ID:irania,项目名称:tirax,代码行数:7,代码来源:ChequeView.cs


示例3: DoGeyser

        public static void DoGeyser(Level lvl, Check C, Random rand) {
            C.time++;
            ushort x, y, z;
            lvl.IntToPos(C.b, out x, out y, out z);
            byte below = lvl.GetTile(x, (ushort)(y - 1), z);
            
            if (below == Block.air) {
                lvl.AddUpdate(lvl.PosToInt(x, (ushort)(y - 1), z), Block.geyser);
            } else if (below != Block.geyser) {
                byte block = lvl.blocks[C.b];
                lvl.PhysWater(lvl.PosToInt((ushort)(x + 1), y, z), block);
                lvl.PhysWater(lvl.PosToInt((ushort)(x - 1), y, z), block);
                lvl.PhysWater(lvl.PosToInt(x, y, (ushort)(z + 1)), block);
                lvl.PhysWater(lvl.PosToInt(x, y, (ushort)(z - 1)), block);
            }

            if (lvl.physics <= 1 || C.time <= 10) return;
            C.time = 0;
            bool flowUp = false;
            
            GeyserFlow(lvl, x - 1, y, z, ref flowUp);
            GeyserFlow(lvl, x + 1, y, z, ref flowUp);
            GeyserFlow(lvl, x, y - 1, z, ref flowUp);
            GeyserFlow(lvl, x, y, z - 1, ref flowUp);
            GeyserFlow(lvl, x, y, z + 1, ref flowUp);
            if (flowUp)
                GeyserFlow(lvl, x, y + 1, z, ref flowUp);
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:28,代码来源:ExtLiquidPhysics.cs


示例4: DoFlood

 public static void DoFlood(Level lvl, Check C, Random rand, AirFlood mode, byte block) {
     if (C.time >= 1) {
         lvl.AddUpdate(C.b, 0);
         C.time = 255; return;
     }
     ushort x, y, z;
     lvl.IntToPos(C.b, out x, out y, out z);
     
     FloodAir(lvl, lvl.PosToInt((ushort)(x + 1), y, z), block);
     FloodAir(lvl, lvl.PosToInt((ushort)(x - 1), y, z), block);
     FloodAir(lvl, lvl.PosToInt(x, y, (ushort)(z + 1)), block);
     FloodAir(lvl, lvl.PosToInt(x, y, (ushort)(z - 1)), block);
     
     switch (mode) {
         case AirFlood.Full:
             FloodAir(lvl, lvl.PosToInt(x, (ushort)(y - 1), z), block);
             FloodAir(lvl, lvl.PosToInt(x, (ushort)(y + 1), z), block);
             break;
         case AirFlood.Layer:
             break;
         case AirFlood.Down:
             FloodAir(lvl, lvl.PosToInt(x, (ushort)(y - 1), z), block);
             break;
         case AirFlood.Up:
             FloodAir(lvl, lvl.PosToInt(x, (ushort)(y + 1), z), block);
             break;
     }
     C.time++;
 }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:29,代码来源:AirPhysics.cs


示例5: AddCheck

 public static Check AddCheck(Check check)
 {
     if (!isTesting)
         return prov.AddCheck(check);
     else
         return testprov.AddCheck(check);
 }
开发者ID:JSamp701,项目名称:Predator-Check-Management-System,代码行数:7,代码来源:CheckService.cs


示例6: Upsert

		void Upsert(Check check)
		{
			if (check.Id == 0)
				repo.Add(check);
			else
				repo.Update(check);
		}
开发者ID:flolovebit,项目名称:xamarin-evolve-2014,代码行数:7,代码来源:Checkbook.cs


示例7: CteateCheck

 public Check CteateCheck()
 {
     Check newCheck = new Check();
     checks.Add(newCheck);
     newCheck.Show();
     return newCheck;
 }
开发者ID:irinalesina,项目名称:ITStepProjects,代码行数:7,代码来源:Cashbox.cs


示例8: update

 // Update Check <check>
 public static bool update(Check check)
 {
     using (DataClasses1DataContext database = new DataClasses1DataContext(Globals.connectionString))
     {
         var query = from a in database.Checks
                     where (a.CheckID == check.CheckID)
                     select a;
         foreach (var a in query)
         {
             a.CheckAmount = check.CheckAmount;
             a.CheckAmountOwed = check.CheckAmountOwed;
             a.CheckCashierID = check.CheckCashierID;
             a.CheckDate = check.CheckDate;
             a.CheckDeleted = check.CheckDeleted;
             a.CheckNum = check.CheckNum;
             a.CheckPaidDate = check.CheckPaidDate;
         }
         try
         {
             database.SubmitChanges();
             return true;
         }
         catch (Exception e)
         {
             return false;
         }
     }
 }
开发者ID:captaintino,项目名称:Bounced-Check-Manager,代码行数:29,代码来源:CheckDAO.cs


示例9: delete

 // Delete Check <check> from database
 public static bool delete(Check check)
 {
     using (DataClasses1DataContext database = new DataClasses1DataContext(Globals.connectionString))
     {
         var query = from c in database.Checks
                     where (c.CheckID == check.CheckID)
                     select c;
         // It seems to me that a single account renders the foreach unnecessary. However, I can't
         // find another way to get the variable 'a' from 'query'.
         foreach (var c in query)
         {
             database.Checks.DeleteOnSubmit(c);
             try
             {
                 database.SubmitChanges();
                 return true;
             }
             catch (Exception e)
             {
                 return false;
             }
         }
         return false;
     }
 }
开发者ID:captaintino,项目名称:Bounced-Check-Manager,代码行数:26,代码来源:CheckDAO.cs


示例10: Do

        public static void Do(Level lvl, Check C, Random rand) {
            int dirX = rand.Next(1, 10) <= 5 ? 1 : -1;
            int dirY = rand.Next(1, 10) <= 5 ? 1 : -1;
            int dirZ = rand.Next(1, 10) <= 5 ? 1 : -1;
            ushort x, y, z;
            lvl.IntToPos(C.b, out x, out y, out z);

            for (int cx = -dirX; cx != 2 * dirX; cx += dirX)
                for (int cy = -dirY; cy != 2 * dirY; cy += dirY)
                    for (int cz = -dirZ; cz != 2 * dirZ; cz += dirZ)
            {                
                byte rocketTail = lvl.GetTile((ushort)(x + cx), (ushort)(y + cy), (ushort)(z + cz));
                if (rocketTail != Block.fire) continue;
                
                int headIndex = lvl.PosToInt((ushort)(x - cx), (ushort)(y - cy), (ushort)(z - cz));
                byte rocketHead = headIndex < 0 ? Block.Zero : lvl.blocks[headIndex];                
                bool unblocked = !lvl.ListUpdate.Exists(u => u.b == headIndex || u.b == C.b);
                
                if (unblocked && (rocketHead == Block.air || rocketHead == Block.rocketstart)) {
                    lvl.AddUpdate(headIndex, Block.rockethead);
                    lvl.AddUpdate(C.b, Block.fire);
                } else if (rocketHead == Block.fire) {
                } else {
                    if (lvl.physics > 2)
                        lvl.MakeExplosion(x, y, z, 2);
                    else
                        lvl.AddUpdate(C.b, Block.fire);
                }
            }
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:30,代码来源:RocketPhysics.cs


示例11: Do

		public static void Do(Level lvl, Check C, Random rand) {
			int dirX = rand.Next(1, 10) <= 5 ? 1 : -1;
			int dirY = rand.Next(1, 10) <= 5 ? 1 : -1;
			int dirZ = rand.Next(1, 10) <= 5 ? 1 : -1;
			ushort x, y, z;
			lvl.IntToPos(C.b, out x, out y, out z);

			for (int cx = -dirX; cx != 2 * dirX; cx += dirX)
				for (int cy = -dirY; cy != 2 * dirY; cy += dirY)
					for (int cz = -dirZ; cz != 2 * dirZ; cz += dirZ)
			{
				byte tileBelow = lvl.GetTile((ushort)(x + cx),(ushort)(y + cy - 1), (ushort)(z + cz));
				byte tile = lvl.GetTile((ushort)(x + cx),(ushort)(y + cy), (ushort)(z + cz));
				
				if ((tileBelow == Block.red || tileBelow == Block.op_air) &&
				    (tile == Block.air || tile == Block.water)) {
					lvl.AddUpdate(lvl.PosToInt((ushort)(x + cx), 
					                           (ushort)(y + cy), (ushort)(z + cz)), Block.train);
					lvl.AddUpdate(C.b, Block.air);
					
					byte newBlock = tileBelow == Block.red ? Block.obsidian : Block.glass;
					lvl.AddUpdate(lvl.IntOffset(C.b, 0, -1, 0), newBlock, true,
					          "wait 5 revert " + tileBelow.ToString());
					return;
				}
			}
		}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:27,代码来源:TrainPhysics.cs


示例12: ContrainteCheck

 public ContrainteCheck(Table entite, string nomContrainte)
     : this()
 {
     arrayCK = entite.CK;
     arrayAttributs = entite.attributs;
     check = new Check (nomContrainte);
 }
开发者ID:hbt,项目名称:oracle-script-generator,代码行数:7,代码来源:ContrainteCheck.cs


示例13: Do

        public static void Do(Level lvl, Check C, Random rand) {
            ushort x, y, z;
            lvl.IntToPos(C.b, out x, out y, out z);
            
            if (lvl.GetTile(x, (ushort)(y - 1), z) != Block.lavastill)
                return;
            
            if (lvl.GetTile(x, (ushort)(y + 1), z) == Block.air) {
                bool keepGoing = true;
                if ((lvl.Height * 80 / 100) < y)
                    keepGoing = rand.Next(1, 20) > 1;

                if (keepGoing) {
                    int bAbove = lvl.PosToInt(x, (ushort)(y + 1), z);
                    bool unblocked = !lvl.ListUpdate.Exists(u => u.b == bAbove);
                    if (unblocked) {
                        lvl.AddUpdate(bAbove, Block.firework, false);
                        lvl.AddUpdate(C.b, Block.lavastill, false, "wait 1 dissipate 100");
                        C.extraInfo = "wait 1 dissipate 100";
                        return;
                    }
                }
            }
            Firework(x, y, z, 4, lvl, rand);
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:25,代码来源:FireworkPhysics.cs


示例14: GetList

        private static List<List<string>> GetList(string fileName, Check check, DayOfWeek dayOfWeek = DayOfWeek.Monday, int numberOfWeek = -1, string subgroup = "-1")
        {
            var settings = new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true };
            var elementsList = new List<List<string>>();
            try
            {
                var xmlReader = XmlReader.Create(fileName, settings);
                xmlReader.Read(); //декларация
                xmlReader.Read(); //коренной элемент
                xmlReader.Read(); //дочерний элемент
                while (!xmlReader.EOF)
                {
                    List<string> element = ReadOne(ref xmlReader);
                    if ((check == null && element != null && element.Count > 0) ||
                        (check != null && check(dayOfWeek, numberOfWeek, subgroup, element)))
                    {
                        elementsList.Add(element);
                    }
                }
                xmlReader.Close();
            }
            catch (FileNotFoundException)
            {
                File.Create(fileName);
            }
            catch (Exception)
            {
                elementsList = null;
            }

            return elementsList;
        }
开发者ID:VolAnder123,项目名称:myWorks,代码行数:32,代码来源:XML.cs


示例15: RemoveError

 private static void RemoveError(Check check)
 {
     if (_tracker.ContainsKey(check))
     {
         _tracker.Remove(check);
     }
 }
开发者ID:mplacona,项目名称:SiteWarmer,代码行数:7,代码来源:FileLogger.cs


示例16: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            StaticTest test = new StaticTest();

            test.FileName = txtFileName.Text;
            test.MaxScores = txtMaxScores.Text;
            Variable[] vars = new Variable[dgVars.Rows.Count];
            int cnt = 0;
            foreach (DataGridViewRow dgvr in dgVars.Rows)
            {
                string name = dgvr.Cells[0].Value + "";
                if (!name.Equals(""))
                {
                    vars[cnt] = new Variable();
                    vars[cnt].Name = name;
                    vars[cnt].DataType = dgvr.Cells[1].Value + "";
                    vars[cnt].Score = Int32.Parse(dgvr.Cells[2].Value + "");
                    vars[cnt].ErrMsg = dgvr.Cells[3].Value + "";
                    cnt++;
                }
            }
            test.Vars = vars;
            cnt = 0;
            Statement[] stmts = new Statement[dgStmts.Rows.Count];
            foreach (DataGridViewRow dgvr in dgStmts.Rows)
            {
                string type = dgvr.Cells[0].Value + "";
                if (!type.Equals(""))
                {
                    stmts[cnt] = new Statement();
                    stmts[cnt].Type = type;
                    stmts[cnt].Score = dgvr.Cells[1].Value + "";
                    stmts[cnt].ErrMsg = dgvr.Cells[2].Value + "";
                    cnt++;
                }
            }
            test.Stmts = stmts;
            Exceptions ex = new Exceptions();
            Check []checks = new Check[dgExceptions.Rows.Count];
            cnt = 0;
            foreach (DataGridViewRow dgvr in dgExceptions.Rows)
            {
                string type = dgvr.Cells[0].Value + "";
                if (!type.Equals(""))
                {
                    checks[cnt] = new Check();
                    checks[cnt].Type = type;
                    checks[cnt].Count = dgvr.Cells[1].Value + "";
                    checks[cnt].Statement = dgvr.Cells[2].Value + "";
                    checks[cnt].Score = dgvr.Cells[3].Value + "";
                    checks[cnt].ErrMsg = dgvr.Cells[4].Value + "";
                }
            }
            ex.Checks = checks;
            test.Ex = new Exceptions[] { ex };
            TestSuiteDB.saveStaticTest(test);
            MessageBox.Show("Static Check Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Hide();
        }
开发者ID:senthilkumarv,项目名称:home,代码行数:59,代码来源:StaticCheck.cs


示例17: buildContentFromEnum

 public static GUIContent[] buildContentFromEnum(Check check, Type toBuild)
 {
     int arraySize = Enum.GetValues(toBuild).Length;
     GUIContent[] content = new GUIContent[arraySize];
     for (int i = 0; i < arraySize; i++)
         content[i] = new GUIContent(Enum.Parse(toBuild, i.ToString()).ToString());
     return content;
 }
开发者ID:Kerbas-ad-astra,项目名称:FE-Part-Search,代码行数:8,代码来源:SearchUtils.cs


示例18: StringElement

 internal StringElement(uint tag, String[] values, int maxLen, bool IsText, Trim trim, Check chk, Encoding encoding )
     : base(tag, null)
 {
     this.trim = trim;
     this.maxLen = maxLen;
     this.IsText = IsText;
     m_data = toByteBuffer( values, trim, chk == null ? new Check( DoCheck ) : chk, encoding );
 }
开发者ID:sleighter,项目名称:dicom-sharp,代码行数:8,代码来源:StringElement.cs


示例19: buildContentFromList

 public static GUIContent[] buildContentFromList(Check check, List<string> toBuild)
 {
     int arraySize = toBuild.Count;
     GUIContent[] content = new GUIContent[arraySize];
     for (int i = 0; i < arraySize; i++)
         content[i] = new GUIContent(toBuild[i]);
     return content;
 }
开发者ID:Kerbas-ad-astra,项目名称:FE-Part-Search,代码行数:8,代码来源:SearchUtils.cs


示例20: Player

 public Player(IActionManager bl, ISetting setting, Random rd)
     : base(bl, setting, rd)
 {
     NbTry = 1;
     CheckCharacter = new Check(bl);
     gameOver = new EndGame(bl);
     PropertyChanged += Play_PropertyChanged;
 }
开发者ID:bahilo,项目名称:HiddenWord,代码行数:8,代码来源:Player.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CheckBox类代码示例发布时间:2022-05-24
下一篇:
C# ChatTypeEnum类代码示例发布时间: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