/// <summary>
        ///     右の当たり判定を計算します。
        /// </summary>
        public virtual ObjectHitFlag CollisionRight()
        {
            int x, y;
            var retval = ObjectHitFlag.NotHit;

            for (y = (int) (Location.Y + Collision.Top) + Size.Height / 6;
                y < (int) (Location.Y + Collision.Bottom);
                y += (int) Collision.Height / 3)
            {
                x = (int) (Location.X + Collision.X + Collision.Width);
                var pnt = new Point(x, y);
                if (pnt.IsOutOfRange())
                    continue;
                var hit = Mpts[Map[x / 16, y / 16, 0]].CheckHit(x % 16, y % 16);
                switch (hit)
                {
                    case ObjectHitFlag.NotHit:
                        break;
                    case ObjectHitFlag.Hit:
                        if (Mpts[Map[x / 16, (y - 1) / 16, 0]].CheckHit(x % 16, (y - 1) % 16) == ObjectHitFlag.NotHit)
                            Location.Y -= this is EntityPlayer && (((EntityPlayer) this).Form == PlayerForm.Big) ? 2 : 1;
                        else
                            Location.X--;
                        if (this is EntityTurcosShell && ((EntityTurcosShell) this).IsRunning)
                            if (Map[x / 16, y / 16, 0] == 9) //ブロック破壊
                            {
                                SoundUtility.PlaySound(Sounds.Destroy);
                                Map[x / 16, y / 16, 0] = 0;
                                ParticleUtility.BrokenBlock(new Point(x, y), Parent, Mpts);
                            }
                        Velocity.X = 0;
                        retval = ObjectHitFlag.Hit;
                        break;
                    case ObjectHitFlag.Damage:
                        Kill();
                        goto case ObjectHitFlag.Hit;
                    case ObjectHitFlag.Death:
                        Kill();
                        goto case ObjectHitFlag.Hit;
                }
                if (x < GameEngine.Map.Width * 16 - 1)
                    if (Mpts[Map[(x + 1) / 16, y / 16, 0]].CheckHit((x + 1) % 16, y % 16) == ObjectHitFlag.Hit)
                        retval = ObjectHitFlag.Hit;
                if (GameEngine.IsDebugMode)
                    DX.DrawPixel(GameEngine.Ks.Camera.X + x, GameEngine.Ks.Camera.Y + y, DX.GetColor(255, 255, 255));
            }
            foreach (IScaffold sc in Parent.FindEntitiesByType<IScaffold>())
            {
                if (sc == this)
                    continue;
                if (new Rectangle((int) (Location.X + Collision.Left), (int) (Location.Y + Collision.Y), 1, (int) Collision.Height)
                    .CheckCollision(
                        new Rectangle((int) (sc.Location.X + sc.Collision.Left), (int) (sc.Location.Y + sc.Collision.Y),
                            (int) sc.Collision.Width, (int) sc.Collision.Height)))
                {
                    Location.X--;
                    Velocity.X = 0;
                    retval = ObjectHitFlag.Hit;
                }
            }
            return retval;
        }
        /// <summary>
        ///     上の当たり判定を計算します。
        /// </summary>
        public virtual ObjectHitFlag CollisionTop()
        {
            int x, y;
            var retval = ObjectHitFlag.NotHit;

            for (x = (int) (Location.X + Collision.Left) + (int) Collision.Width / 4;
                x < (int) (Location.X + Collision.Right);
                x += (int) Collision.Width / 2)
            {
                y = (int) (Location.Y + Collision.Y);
                var pnt = new Point(x, y);
                if (pnt.IsOutOfRange())
                    continue;
                var hit = Mpts[Map[x / 16, y / 16, 0]].CheckHit(x % 16, y % 16);
                switch (hit)
                {
                    case ObjectHitFlag.Hit:
                        //if (Mpts[Map[x / 16, y / 16, 0]].CheckHit(x % 16, (y + 1) % 16) == ObjectHitFlag.Hit)
                        Location.Y++;
                        Velocity.Y = 0;
                        if (this is EntityPlayer)
                            if (IsJumping && (Map[x / 16, y / 16, 0] == 9)) //ブロック破壊
                            {
                                SoundUtility.PlaySound(Sounds.Destroy);
                                Map[x / 16, y / 16, 0] = 0;
                                ParticleUtility.BrokenBlock(new Point(x, y), Parent, Mpts);
                            }
                        break;
                    case ObjectHitFlag.Damage:
                        Kill();
                        goto case ObjectHitFlag.Hit;
                    case ObjectHitFlag.Death:
                        Kill();
                        goto case ObjectHitFlag.Hit;
                }
                if (y > 0)
                    if (Mpts[Map[x / 16, (y - 1) / 16, 0]].CheckHit(x % 16, (y - 1) % 16) == ObjectHitFlag.Hit)
                        retval = ObjectHitFlag.Hit;
                if (GameEngine.IsDebugMode)
                    DX.DrawPixel(GameEngine.Ks.Camera.X + x, GameEngine.Ks.Camera.Y + y, DX.GetColor(255, 255, 255));
            }
            foreach (IScaffold sc in Parent.FindEntitiesByType<IScaffold>())
            {
                if (sc == this)
                    continue;
                if (new Rectangle((int) (Location.X + Collision.Left), (int) (Location.Y + Collision.Y), (int) Collision.Width, 1)
                    .CheckCollision(
                        new Rectangle((int) (sc.Location.X + sc.Collision.Left), (int) (sc.Location.Y + sc.Collision.Y),
                            (int) sc.Collision.Width, (int) sc.Collision.Height)))
                {
                    Location.Y++;
                    Velocity.Y = 0;
                }
            }
            return retval;
        }
        /// <summary>
        ///     下の当たり判定を計算します。
        /// </summary>
        public virtual ObjectHitFlag CollisionBottom()
        {
            int x, y;
            var retval = ObjectHitFlag.NotHit;
            IsOnLand = false;
            for (x = (int) (Location.X + Collision.Left) + (int) Collision.Width / 4;
                x < (int) (Location.X + Collision.Right);
                x += (int) Collision.Width / 2)
            {
                y = (int) (Location.Y + Collision.Y + Collision.Height);
                var pnt = new Point(x, y);
                if (pnt.IsOutOfRange())
                    continue;
                var hit = Mpts[Map[x / 16, y / 16, 0]].CheckHit(x % 16, y % 16);

                switch (hit)
                {
                    case ObjectHitFlag.NotHit:
                        //IsOnLand = false;
                        break;
                    case ObjectHitFlag.Hit:
                        if (Mpts[Map[x / 16, (y - 1) / 16, 0]].CheckHit(x % 16, (y - 1) % 16) == ObjectHitFlag.Hit)
                            Location.Y--;
                        IsOnLand = true;
                        IsJumping = false;
                        retval = ObjectHitFlag.Hit;
                        if (Velocity.Y > 0)
                            Velocity.Y = 0;
                        break;
                    case ObjectHitFlag.Damage:
                        Kill();
                        goto case ObjectHitFlag.Hit;
                    case ObjectHitFlag.Death:
                        Kill();
                        goto case ObjectHitFlag.Hit;
                }
                if (y < GameEngine.Map.Height * 16 - 1)
                    if (Mpts[Map[x / 16, (y + 1) / 16, 0]].CheckHit(x % 16, (y + 1) % 16) == ObjectHitFlag.Hit)
                        retval = ObjectHitFlag.Hit;
                if (GameEngine.IsDebugMode)
                    DX.DrawPixel(GameEngine.Ks.Camera.X + x, GameEngine.Ks.Camera.Y + y, DX.GetColor(255, 255, 255));
            }
            foreach (IScaffold sc in Parent.FindEntitiesByType<IScaffold>())
            {
                if (sc == this)
                    continue;
                if (new Rectangle((int) (Location.X + Collision.Left), (int) (Location.Y + Collision.Bottom), (int) Collision.Width,
                    1).CheckCollision(
                    new Rectangle((int) (sc.Location.X + sc.Collision.Left), (int) (sc.Location.Y + sc.Collision.Y),
                        (int) sc.Collision.Width, (int) sc.Collision.Height)))
                {
                    Location.Y--;
                    IsOnLand = true;
                    if (Velocity.Y > 0)
                        Velocity.Y = 0;
                    retval = ObjectHitFlag.Hit;
                }
            }
            return retval;
        }