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


C# Grid.AddPoint方法代码示例

本文整理汇总了C#中Grid.AddPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.AddPoint方法的具体用法?C# Grid.AddPoint怎么用?C# Grid.AddPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Grid的用法示例。


在下文中一共展示了Grid.AddPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Remove_coordinate

 public void Remove_coordinate()
 {
     var g = new Grid();
     g.AddPoint(1, 1);
     Assert.That(g.Has(1, 1));
     g.RemovePoint(1, 1);
     Assert.That(g.Has(1, 1), Is.False);
 }
开发者ID:robdmoore,项目名称:gameoflife_csharp,代码行数:8,代码来源:GridTests.cs

示例2: Returns_all_points

 public void Returns_all_points()
 {
     var g = new Grid();
     g.AddPoint(1, 2);
     var p = g.GetAll();
     Assert.That(p, Has.Count.EqualTo(1));
     Assert.That(p, Has.Member(new Point(1,2)));
 }
开发者ID:robdmoore,项目名称:gameoflife_csharp,代码行数:8,代码来源:GridTests.cs

示例3: Expands_two_point_grid_correctly

 public void Expands_two_point_grid_correctly()
 {
     var g = new Grid();
     g.AddPoint(1, 2);
     g.AddPoint(1, 3);
     var p = g.Expand().GetAll();
     Assert.That(p, Has.Count.EqualTo(12));
     Assert.That(p, Has.Member(new Point(1, 2)));
     Assert.That(p, Has.Member(new Point(0, 1)));
     Assert.That(p, Has.Member(new Point(1, 1)));
     Assert.That(p, Has.Member(new Point(2, 1)));
     Assert.That(p, Has.Member(new Point(0, 2)));
     Assert.That(p, Has.Member(new Point(2, 2)));
     Assert.That(p, Has.Member(new Point(0, 3)));
     Assert.That(p, Has.Member(new Point(1, 3)));
     Assert.That(p, Has.Member(new Point(2, 3)));
     Assert.That(p, Has.Member(new Point(0, 4)));
     Assert.That(p, Has.Member(new Point(1, 4)));
     Assert.That(p, Has.Member(new Point(2, 4)));
 }
开发者ID:robdmoore,项目名称:gameoflife_csharp,代码行数:20,代码来源:GridTests.cs

示例4: Return_correct_dimensions

        public void Return_correct_dimensions()
        {
            var g = new Grid();
            g.AddPoint(-1, -5);
            g.AddPoint(5, 10);
            var d = g.GetDimensions();

            Assert.That(d.MinX, Is.EqualTo(-1));
            Assert.That(d.MinY, Is.EqualTo(-5));
            Assert.That(d.MaxX, Is.EqualTo(5));
            Assert.That(d.MaxY, Is.EqualTo(10));
        }
开发者ID:robdmoore,项目名称:gameoflife_csharp,代码行数:12,代码来源:GridTests.cs


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