当前位置: 首页>>代码示例>>C#>>正文


C# Check类代码示例

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


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


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