Пример #1
0
        private static RandomData _CreateAdjustPlayerPhaseRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.ADJUSTMENT_PLAYER_PHASE,
                Randoms = new List<IRandom>()
            };

            data.Randoms.Add(Random.Instance);
            data.Randoms.Add(Random.Instance);
            return data;
        }
Пример #2
0
        private static RandomData _CreateTreasureRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.CHECK_TREASURE,
                Randoms = new List<IRandom>()
            };

            data.Randoms.Add(Random.Instance);
            data.Randoms.Add(Random.Instance);

            return data;
        }
Пример #3
0
        private static RandomData _CreateDeathRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.DEATH,
                Randoms = new List<IRandom>()
            };

            data.Randoms.Add(Random.Instance);
            data.Randoms.Add(Random.Instance);

            return data;
        }
Пример #4
0
        private RandomData _CreateAdjustPlayerPhaseRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.ADJUSTMENT_PLAYER_PHASE,
                Randoms = new List<IRandom>()
            };

            var r = Substitute.For<IRandom>();
            r.NextInt(0, 1000).Returns(1000);
            data.Randoms.Add(r);

            return data;
        }
Пример #5
0
        private RandomData _CreateTreasureRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.CHECK_TREASURE,
                Randoms = new List<IRandom>()
            };

            var r = Substitute.For<IRandom>();
            r.NextInt(0, 0x10000000).Returns(0x10000000);
            data.Randoms.Add(r);

            r = Substitute.For<IRandom>();
            r.NextFloat(0, 1).Returns(1);
            data.Randoms.Add(r);

            return data;
        }
Пример #6
0
        private RandomData _CreateOddsRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.ODDS,
                Randoms = new List<IRandom>()
            };

            var r = Substitute.For<IRandom>();
            r.NextInt(0, 1000).Returns(1000);
            data.Randoms.Add(r);

            r = Substitute.For<IRandom>();
            r.NextInt(0, 1000).Returns(1000);
            data.Randoms.Add(r);

            r = Substitute.For<IRandom>();
            r.NextInt(0, 1000).Returns(1000);
            data.Randoms.Add(r);

            r = Substitute.For<IRandom>();
            r.NextInt(0, 1000).Returns(1000);
            data.Randoms.Add(r);

            r = Substitute.For<IRandom>();
            r.NextInt(0, 1000).Returns(1000);
            data.Randoms.Add(r);

            return data;
        }
Пример #7
0
        private RandomData _CreateDeathRandom()
        {
            var data = new RandomData
            {
                RandomType = RandomData.RULE.DEATH,
                Randoms = new List<IRandom>()
            };

            var r = Substitute.For<IRandom>();
            r.NextInt(0, 0x10000000).Returns(0x10000000);
            data.Randoms.Add(r);

            r = Substitute.For<IRandom>();
            r.NextInt(0, 0x10000000).Returns(0x10000000);
            data.Randoms.Add(r);

            return data;
        }
Пример #8
0
 public IRandom FindIRandom(RandomData.RULE rule_type, int index)
 {
     return CreateRandom.GetRandoms()
                         .Find(x => x.RandomType == rule_type)
                         .Randoms.ElementAt(index);
 }