示例#1
0
文件: Lion.cs 项目: jbfp/SavannahGame
        public override void Visit(Rabbit rabbit)
        {
            if (rabbit.IsAlive == false)
            {
                return;
            }

            GainWeight(rabbit.Weight * 1.0);
            rabbit.Deactivate();
            base.Visit(rabbit);
        }
示例#2
0
        public override void Visit(Rabbit rabbit)
        {
            if (rabbit.IsAlive == false)
            {
                return;
            }

            GainWeight(rabbit.Weight * 1.0);
            rabbit.Deactivate();
            base.Visit(rabbit);
        }
示例#3
0
        public override void Visit(Rabbit rabbit)
        {
            if (rabbit.Gender == Gender)
            {
                return;
            }

            for (int i = 0; i < 2; i++)
            {
                var gender = (Gender)Random.Next(0, 2);
                var bunny  = new Rabbit(this.spawner, gender);
                this.spawner.Spawn(bunny);
            }

            base.Visit(rabbit);
        }
示例#4
0
        public override void Visit(Rabbit rabbit)
        {
            if (rabbit.Gender == Gender)
            {
                return;
            }

            for (int i = 0; i < 2; i++)
            {
                var gender = (Gender)Random.Next(0, 2);
                var bunny = new Rabbit(this.spawner, gender);
                this.spawner.Spawn(bunny);
            }

            base.Visit(rabbit);
        }