Beispiel #1
0
        private void PrepareToMoveToNextTerrain(Vector3 PlayerPosition, int LayerIndex, bool AllowDirectionChange)
        {
            Dictionary <Directions, TerrainSorcererStreet> DicNextTerrain = GetNextTerrains(Map, (int)PlayerPosition.X, (int)PlayerPosition.Y, LayerIndex, ActivePlayer.CurrentDirection);

            if (!AllowDirectionChange)
            {
                MoveToNextTerrain(DicNextTerrain[ActivePlayer.CurrentDirection]);
            }
            else if (DicNextTerrain.Count > 1)
            {
                DirectionPicker = new ActionPanelChooseDirection(Map, ActivePlayerIndex, DicNextTerrain);
                AddToPanelListAndSelect(DirectionPicker);
            }
            else
            {
                MoveToNextTerrain(DicNextTerrain.First().Value);
            }
        }
Beispiel #2
0
        public override void DoUpdate(GameTime gameTime)
        {
            if (DirectionPicker != null && DirectionPicker.ChosenTerrain != null)
            {
                MoveToNextTerrain(DirectionPicker.ChosenTerrain);
                DirectionPicker = null;
            }

            if (Map.MovementAnimation.Count == 0)
            {
                if (Movement > 0)
                {
                    PrepareToMoveToNextTerrain(ActivePlayer.GamePiece.Position, (int)ActivePlayer.GamePiece.Position.Z, true);
                }
                else
                {
                    RemoveFromPanelList(this);
                    TerrainSorcererStreet ActiveTerrain = Map.GetTerrain(ActivePlayer.GamePiece);

                    ActiveTerrain.OnSelect(Map, ActivePlayerIndex);
                }
            }
        }