Exemplo n.º 1
0
 public OtherPhysics(Game game, PhysicsBase physics)
 {
     this.game = game;
     map       = game.World;
     physics.OnPlace[Block.Slab]            = HandleSlab;
     physics.OnPlace[Block.CobblestoneSlab] = HandleCobblestoneSlab;
 }
Exemplo n.º 2
0
 public TNTPhysics(Game game, PhysicsBase physics)
 {
     this.game    = game;
     map          = game.World;
     this.physics = physics;
     physics.OnDelete[Block.TNT] = HandleTnt;
 }
Exemplo n.º 3
0
 public SinglePlayerServer(Game window)
 {
     game                    = window;
     physics                 = new PhysicsBase(game);
     SupportsFullCP437       = !game.ClassicMode;
     SupportsPartialMessages = true;
 }
Exemplo n.º 4
0
 public SinglePlayerServer(Game game)
 {
     this.game               = game;
     physics                 = new PhysicsBase(game);
     SupportsFullCP437       = !game.ClassicMode;
     SupportsPartialMessages = true;
     IsSinglePlayer          = true;
 }
Exemplo n.º 5
0
        public FallingPhysics(Game game, PhysicsBase physics)
        {
            this.game    = game;
            map          = game.World;
            this.physics = physics;

            physics.OnPlace[Block.Sand]        = DoFalling;
            physics.OnPlace[Block.Gravel]      = DoFalling;
            physics.OnActivate[Block.Sand]     = DoFalling;
            physics.OnActivate[Block.Gravel]   = DoFalling;
            physics.OnRandomTick[Block.Sand]   = DoFalling;
            physics.OnRandomTick[Block.Gravel] = DoFalling;
        }
        public FoliagePhysics(Game game, PhysicsBase physics)
        {
            this.game    = game;
            this.physics = physics;
            map          = game.World;

            physics.OnPlace[Block.Sapling]      = HandleSapling;
            physics.OnRandomTick[Block.Sapling] = HandleSapling;
            physics.OnRandomTick[Block.Dirt]    = HandleDirt;
            physics.OnRandomTick[Block.Grass]   = HandleGrass;

            physics.OnRandomTick[Block.Dandelion]     = HandleFlower;
            physics.OnRandomTick[Block.Rose]          = HandleFlower;
            physics.OnRandomTick[Block.RedMushroom]   = HandleMushroom;
            physics.OnRandomTick[Block.BrownMushroom] = HandleMushroom;
        }
Exemplo n.º 7
0
        public void TickLava()
        {
            int count = Lava.Count;

            for (int i = 0; i < count; i++)
            {
                int index;
                if (PhysicsBase.CheckItem(Lava, out index))
                {
                    BlockID block = map.blocks[index];
                    if (!(block == Block.Lava || block == Block.StillLava))
                    {
                        continue;
                    }
                    ActivateLava(index, block);
                }
            }
        }
Exemplo n.º 8
0
        public void TickWater()
        {
            int count = Water.Count;

            for (int i = 0; i < count; i++)
            {
                int index;
                if (PhysicsBase.CheckItem(Water, out index))
                {
                    BlockID block = map.blocks[index];
                    if (!(block == Block.Water || block == Block.StillWater))
                    {
                        continue;
                    }
                    ActivateWater(index, block);
                }
            }
        }
Exemplo n.º 9
0
        public LiquidPhysics(Game game, PhysicsBase physics)
        {
            this.game = game;
            map       = game.World;

            physics.OnPlace[Block.Lava]    = OnPlaceLava;
            physics.OnPlace[Block.Water]   = OnPlaceWater;
            physics.OnPlace[Block.Sponge]  = PlaceSponge;
            physics.OnDelete[Block.Sponge] = DeleteSponge;

            physics.OnActivate[Block.Water]      = physics.OnPlace[Block.Water];
            physics.OnActivate[Block.StillWater] = physics.OnPlace[Block.Water];
            physics.OnActivate[Block.Lava]       = physics.OnPlace[Block.Lava];
            physics.OnActivate[Block.StillLava]  = physics.OnPlace[Block.Lava];

            physics.OnRandomTick[Block.Water]      = ActivateWater;
            physics.OnRandomTick[Block.StillWater] = ActivateWater;
            physics.OnRandomTick[Block.Lava]       = ActivateLava;
            physics.OnRandomTick[Block.StillLava]  = ActivateLava;
        }
Exemplo n.º 10
0
        public LiquidPhysics(Game game, PhysicsBase physics)
        {
            this.game = game;
            map       = game.World;
            info      = game.BlockInfo;

            physics.OnPlace[Block.Lava] =
                (index, b) => Lava.Enqueue(defLavaTick | (uint)index);
            physics.OnPlace[Block.Water] =
                (index, b) => Water.Enqueue(defWaterTick | (uint)index);
            physics.OnPlace[Block.Sponge]  = PlaceSponge;
            physics.OnDelete[Block.Sponge] = DeleteSponge;

            physics.OnActivate[Block.Water]      = physics.OnPlace[Block.Water];
            physics.OnActivate[Block.StillWater] = physics.OnPlace[Block.Water];
            physics.OnActivate[Block.Lava]       = physics.OnPlace[Block.Lava];
            physics.OnActivate[Block.StillLava]  = physics.OnPlace[Block.Lava];

            physics.OnRandomTick[Block.Water]      = ActivateWater;
            physics.OnRandomTick[Block.StillWater] = ActivateWater;
            physics.OnRandomTick[Block.Lava]       = ActivateLava;
            physics.OnRandomTick[Block.StillLava]  = ActivateLava;
        }