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


C# Seed.Equals方法代码示例

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


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

示例1: convertBiome

    private void convertBiome(Seed s, int type)
    {
        float dist = int.MaxValue, dist2 = int.MaxValue;
        bool closest = true;
        for (int i = 0; i < width; i++) {
            for(int j = 0; j < height; j++) {
                if(array[i,j] != 2 && array[i,j] != 1) {
                    dist2 = Mathf.Sqrt(Mathf.Pow(i - s.x, 2) + Mathf.Pow(j - s.y, 2));

                    for(int k = 0; k < isles * circleMod; k++) {
                        if(!s.Equals(seeds[k]))
                            dist = Mathf.Sqrt(Mathf.Pow(i - seeds[k].x, 2) + Mathf.Pow(j - seeds[k].y, 2));

                        if(dist2 > dist) {
                            closest = false;
                            break;
                        }
                    }

                    if(closest && Random.Range (0, 101) <= 80) {
                        array[i, j] = type;
                    }
                    closest = true;
                }
            }
        }
    }
开发者ID:Fierfek,项目名称:MapGenerater,代码行数:27,代码来源:GenerateMap.cs

示例2: SutEqualsOtherSutWhenTypeAndValueEquals

 public void SutEqualsOtherSutWhenTypeAndValueEquals()
 {
     // Fixture setup
     var type = typeof(HttpStyleUriParser);
     var value = new OperatingSystem(PlatformID.WinCE, new Version());
     var sut = new Seed(type, value);
     var other = new Seed(type, value);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsTrue(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:13,代码来源:SeedTest.cs

示例3: SutEqualsOtherSutWhenTypesAreEqualAndValuesAreNull

 public void SutEqualsOtherSutWhenTypesAreEqualAndValuesAreNull()
 {
     // Fixture setup
     var type = typeof(WeakReference);
     var sut = new Seed(type, null);
     var other = new Seed(type, null);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsTrue(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:SeedTest.cs

示例4: SutDoesNotEqualOtherSutWhenSutValueIsNull

 public void SutDoesNotEqualOtherSutWhenSutValueIsNull()
 {
     // Fixture setup
     var anonymousType = typeof(float);
     var sut = new Seed(anonymousType, null);
     var other = new Seed(anonymousType, 2.9f);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:SeedTest.cs

示例5: SutDoesNotEqualOtherSutWhenOtherValueIsNull

 public void SutDoesNotEqualOtherSutWhenOtherValueIsNull()
 {
     // Fixture setup
     var anonymousType = typeof(Buffer);
     var sut = new Seed(anonymousType, new GopherStyleUriParser());
     var other = new Seed(anonymousType, null);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:SeedTest.cs

示例6: SutDoesNotEqualOtherSutWhenValuesDiffer

 public void SutDoesNotEqualOtherSutWhenValuesDiffer()
 {
     // Fixture setup
     var anonymousType = typeof(object);
     var sut = new Seed(anonymousType, 98);
     var other = new Seed(anonymousType, "Anonymous value");
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:SeedTest.cs

示例7: SutDoesNotEqualOtherSutWhenTypesDiffer

 public void SutDoesNotEqualOtherSutWhenTypesDiffer()
 {
     // Fixture setup
     var anonymousValue = 1;
     var sut = new Seed(typeof(string), anonymousValue);
     var other = new Seed(typeof(TimeSpan), anonymousValue);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:SeedTest.cs

示例8: SutDoesNotEqualAnonymousObject

 public void SutDoesNotEqualAnonymousObject()
 {
     // Fixture setup
     var sut = new Seed(typeof(object), "Anonymous value");
     object anonymousObject = new FileStyleUriParser();
     // Exercise system
     var result = sut.Equals(anonymousObject);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:SeedTest.cs

示例9: SutDoesNotEqualNullSut

 public void SutDoesNotEqualNullSut()
 {
     // Fixture setup
     var sut = new Seed(typeof(TimeSpan), new object());
     Seed other = null;
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:SeedTest.cs

示例10: SutDoesNotEqualNullObject

 public void SutDoesNotEqualNullObject()
 {
     // Fixture setup
     var sut = new Seed(typeof(DateTime), new DateTime(103029));
     object other = null;
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:SeedTest.cs


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