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


C# System.Coord类代码示例

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


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

示例1: Shard

 public Shard(Coord ul, Coord ur, Coord ll, Coord lr)
 {
     _ul = ul;
       _ur = ur;
       _ll = ll;
       _lr = lr;
 }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:7,代码来源:Shard.cs

示例2: InitialiseInhab

        private static void InitialiseInhab(Inhabitant thing,Room room,AMaterialStats stats)
        {
            int trytimes = 0;
            bool done = false;
            Coord size = new Coord(3, 3);

            while (!done && trytimes < 20)
            {
                //Random distribution HACK! u can make more distribution types
                int tryx = MyRandom.Random.Next(0, room.RoomOccupiedGrid.GetLength(0) - size.X);
                int tryy = MyRandom.Random.Next(0, room.RoomOccupiedGrid.GetLength(1) - size.Y);

                if (CheckClear(new Coord(tryx, tryy), size,room.RoomOccupiedGrid))
                {
                    MakeNotCLear(new Coord(tryx, tryy), size, room.RoomOccupiedGrid);

                    thing.Initialise(size - new Coord(1, 1)
                   , room.Position + (new Vector2(tryx+1.5f, tryy+1.5f)*Globals.SmallGridSize)
                   , room.RoomAmbient.RoomColour, room.RoomAmbient.GlowColour, stats
                   , room.RoomAmbient.RoomTileset);
                    done = true;
                }
                trytimes++;
            }
        }
开发者ID:Wonko-the-sane,项目名称:Artefact001,代码行数:25,代码来源:InhabitantsFactory.cs

示例3: Main

        private static void Main()
        {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var n = input[0];
            var coord0 = new Coord(input[1], input[2]);
            var rgcoord = new HashSet<Coord>();
            for (var i = 0; i < n; i++)
            {
                input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                rgcoord.Add(new Coord(input[0], input[1]));
            }

            var d = 0;
            while (rgcoord.Any())
            {
                d++;
                var coord = rgcoord.First();
                var vX = coord.x - coord0.x;
                var vY = coord.y - coord0.y;

                foreach (var coordT in rgcoord.ToList())
                {
                    if (vY*(coordT.x - coord0.x) == vX*(coordT.y - coord0.y))
                        rgcoord.Remove(coordT);
                }
            }

            Console.WriteLine(d);
        }
开发者ID:encse,项目名称:codeforces,代码行数:29,代码来源:p514B-9833983.cs

示例4: DrawTargetMark

        private static void DrawTargetMark(Unit currentUnit, Coord target, bool toShow)
        {
            if (toShow)
            {
                ZBuffer.ReadBuffer("targetBuffer", target.X, target.Y, 3, 3);

                var buffer = ZBuffer.BackupBuffer("defaultBuffer");
                ZIOX.OutputType = ZIOX.OutputTypeEnum.Buffer;
                ZIOX.BufferName = "defaultBuffer";

                var targetColor = IsTargetOnSoldier(currentUnit, target) ? Color.Yellow : Color.Cyan;

                ZIOX.Print(target.X-1, target.Y-1, (char)Tools.Get_Ascii_Byte('┌'), targetColor);
                ZIOX.Print(target.X+1, target.Y-1, (char)Tools.Get_Ascii_Byte('┐'), targetColor);
                ZIOX.Print(target.X-1, target.Y+1, (char)Tools.Get_Ascii_Byte('└'), targetColor);
                ZIOX.Print(target.X+1, target.Y+1, (char)Tools.Get_Ascii_Byte('┘'), targetColor);

                MapRender.DrawVisibleUnits(currentUnit);
                ZIOX.OutputType = ZIOX.OutputTypeEnum.Direct;

                ZBuffer.WriteBuffer("defaultBuffer", UIConfig.GameAreaRect.Left, UIConfig.GameAreaRect.Top);
                ZBuffer.SaveBuffer("defaultBuffer", buffer);
            }
            else
            {
                ZBuffer.WriteBuffer("targetBuffer", target.X, target.Y);
            }
        }
开发者ID:ZeroByte1987,项目名称:ConsoleGames,代码行数:28,代码来源:TargetMark.cs

示例5: DoTargetAction

        public static Coord DoTargetAction(Unit unit)
        {
            var exitFlag = false;

            var target = new Coord(unit.Position.X, unit.Position.Y);
            DrawTargetMark(unit, target, true);

            while (!exitFlag)
            {
                var key = ZInput.ReadKey();
                var oldTarget = new Coord(target.X, target.Y);

                switch (key)
                {
                    case ConsoleKey.LeftArrow	:	MoveTarget(target, -1,  0);		break;
                    case ConsoleKey.RightArrow	:	MoveTarget(target, +1,  0);		break;
                    case ConsoleKey.UpArrow		:	MoveTarget(target,  0, -1);		break;
                    case ConsoleKey.DownArrow	:	MoveTarget(target,  0, +1);		break;

                    case ConsoleKey.Enter		:	return target;		break;
                    case ConsoleKey.Escape		:	exitFlag = true;	break;
                }

                if (!oldTarget.Equals(target))
                {
                    DrawTargetMark(unit, oldTarget, false);
                    DrawTargetMark(unit, target, true);
                }
            }

            return null;
        }
开发者ID:ZeroByte1987,项目名称:ConsoleGames,代码行数:32,代码来源:TargetMark.cs

示例6: Room

 public Room(Coord aTopLeft, int aHeight, int aWidth, Direction aDirection)
 {
     iTopLeft = aTopLeft;
     iHeight = aHeight;
     iWidth = aWidth;
     iDoorLocation = aDirection;
 }
开发者ID:kjchiu,项目名称:zomgame-2,代码行数:7,代码来源:Room.cs

示例7: DFS

        private static void DFS(Coord coord, Coord target, long sum, int[,] lab)
        {
            //if (!visited.Contains(coord))
            //{
                visited.Add(coord);

                if (coord.Equals(target))
                {
                    results.Add(sum);
                    return;
                }

                if (lab[coord.X, coord.Y] == 1)
                {
                    sum += 1;
                }

                if (coord.X + 1 < lab.GetLength(0))
                {
                    

                    DFS(new Coord(coord.X + 1, coord.Y), target, sum, lab);
                }
                if (coord.Y + 1 < lab.GetLength(1))
                {

                    DFS(new Coord(coord.X, coord.Y + 1), target, sum, lab);
                }
            //}
        }
开发者ID:GenoGenov,项目名称:TelerikAcademyAssignments,代码行数:30,代码来源:Program.cs

示例8: Pieces

 protected Pieces(string name, Couleur couleur, Coord coord)
 {
     Name = name;
     Couleur = couleur;
     Coord = coord;
     Depart = true;
     Captured = false;
 }
开发者ID:theking973,项目名称:ChessMVC,代码行数:8,代码来源:Pieces.cs

示例9: FlamingLongSword

 public FlamingLongSword(string name = "Flaming Long Sword", Coord position = new Coord())
     : base(name,
            position: position,
            specialAttack: Weapon.WeaponSpecialAttacks.Flaming,
            specialAttackDescription: Weapon.WeaponSpecialAttacks.Flaming.WeaponDescription())
 {
     
 }
开发者ID:Fux90,项目名称:GodsWill_ASCIIRPG,代码行数:8,代码来源:LongSword.cs

示例10: StackItemTest

        public StackItemTest(   Color color = new Color(),
                                string description = "Stackable Item",
                                Coord position = new Coord(),
                                int uses = _UnlimitedUses)
            :base("Stack Item", "s", color: color, cost: 1, description: description, position: position, uses: uses)
        {

        }
开发者ID:Fux90,项目名称:GodsWill_ASCIIRPG,代码行数:8,代码来源:StackItemTest.cs

示例11: ShardSet

 public ShardSet(Coord ul, Coord lr, int n)
 {
     var ur = new Coord(ul.X, lr.Y);
       var ll = new Coord(lr.X, ul.Y);
       _set = Split(new Shard(ul, ur, ll, lr), n);
       Console.WriteLine("n: " + n);
       Console.WriteLine("#shards: " + _set.Count);
 }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:8,代码来源:ShardSet.cs

示例12: IsTargetOnSoldier

 public static bool IsTargetOnSoldier(Unit currentUnit, Coord target)
 {
     foreach (var team in MainGame.Teams)
         foreach (var unit in team.Units.Where(a => a.Name != currentUnit.Name))
             if (target.Equals(unit.Position))
                 return true;
     return false;
 }
开发者ID:ZeroByte1987,项目名称:ConsoleGames,代码行数:8,代码来源:TargetMark.cs

示例13: GenerateByBuilderType

        public static Item GenerateByBuilderType(  Type type, 
                                            Pg.Level level = Pg.Level.Novice, 
                                            Coord position = new Coord())
        {

            return Generators.ContainsKey(type)
                ? Generators[type].GenerateRandom(level, position)
                : null;
        }
开发者ID:Fux90,项目名称:GodsWill_ASCIIRPG,代码行数:9,代码来源:ItemGenerator.cs

示例14: Render

        public byte[] Render(Coord coord, string format, int tileWidth, int tileHeight)
        {
            ProxyProvider proxy;
            if (!this._proxyDictionary.TryGetValue(format.ToString(), out proxy))
                throw new InvalidTileFormatException(
                    string.Format("Invalid tile FORMAT {0}", format)
                );

            return proxy.Render(coord, format, tileWidth, tileHeight);
        }
开发者ID:jbrwn,项目名称:tc,代码行数:10,代码来源:MultiProxyProvider.cs

示例15: Wall

        public Wall(Coord position)
            : base("Wall", 
                   "█", 
                   Color.LightGray, 
                   false, 
                   true,
                   "A rock wall",
                   position)
        {

        }
开发者ID:Fux90,项目名称:GodsWill_ASCIIRPG,代码行数:11,代码来源:Wall.cs


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