예제 #1
0
        public void AddPole()
        {
            if (m_Galleon == null)
            {
                return;
            }

            int dist    = m_Galleon.CaptiveOffset;
            int xOffset = 0;
            int yOffset = 0;

            m_Pole = new BindingPole(this);

            switch (m_Galleon.Facing)
            {
            case Direction.North:
                xOffset = 0;
                yOffset = dist * -1;
                break;

            case Direction.South:
                xOffset = 0;
                yOffset = dist * 1;
                break;

            case Direction.East:
                yOffset = 0;
                xOffset = dist * 1;
                break;

            case Direction.West:
                xOffset = dist * -1;
                yOffset = 0;
                break;
            }

            m_Pole.MoveToWorld(new Point3D(m_Galleon.X + xOffset, m_Galleon.Y + yOffset, m_Galleon.ZSurface), m_Galleon.Map);
            m_Galleon.AddFixture(m_Pole);
        }