Ejemplo n.º 1
0
        public static void EnableMoveMode()
        {
            IsTravelModeEnabled = !IsTravelModeEnabled;

            mainActionButtons.ForEach(_ => { if (_.ActionType != ActionType.Travel)
                                             {
                                                 _.Disable();
                                             }
                                      });
            var b = mainActionButtons.First(_ => _.ActionType == ActionType.Travel);

            b.Enable();
            b.Text = "Cancel Travel";

            foreach (var l in LocationsHelper.GetNeighbourLCCs(Game.Instance.ActivePlayer.CurrentLocationCard, true))
            {
                if (l != null)
                {
                    l.LocationActionBtn.Show();
                    l.LocationActionBtn.Text   = "Move Here";
                    l.LocationActionBtn.Click += MoveClick;
                }
            }
            _MainForm.Instance.Refresh();
        }
Ejemplo n.º 2
0
        public void ActivateMenhir(LocationCardControl lcc, int value)
        {
            lcc.MenhirValue = value;

            foreach (var s in LocationsHelper.GetNeighbourLCCs(lcc))
            {
                AddLocationCardToMap(s);
            }
        }
Ejemplo n.º 3
0
        private static void InspectMenhirActionClick(object sender, EventArgs e)
        {
            var l = LocationsHelper.GetLCControl(((LocationSelectionButton)sender).LocationNumber);

            if (MessageBox.Show(MenhirHelper.GetMenhirActivationDescription(l), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                //_MainForm.Instance.LocationCardsPanel.ActivateMenhir(l,l.men
            }
        }
Ejemplo n.º 4
0
 public void AddMissingMapTiles()
 {
     foreach (var player in Game.Instance.Players)
     {
         foreach (var loc in LocationsHelper.GetNeighbourLocationNumbers(player.CurrentLocationCard))
         {
             if (LocationsHelper.IsLocationNearActiveMenhir(loc) || DebugCheats.IgnoreMenhirVicinityWhenShowNewLocationAfterTravel)
             {
                 AddLocationCardToMap(loc);
             }
         }
     }
 }
Ejemplo n.º 5
0
        public void RemoveLocationsOutsideMenhirRange()
        {
            var LocsToRemove = new List <LocationCardControl>();

            foreach (LocationCardControl l in LocationCards)
            {
                if (!LocationsHelper.IsLocationNearActiveMenhir(l.LocationNumber))
                {
                    LocsToRemove.Add(l);
                }
            }

            foreach (var l in LocsToRemove)
            {
                Controls.Remove(l);
            }
        }
Ejemplo n.º 6
0
        public static ProcessingResult?ProcessAddress(ReceivedMessage message)
        {
            var input = message.Parameter;

            if (String.IsNullOrEmpty(input))
            {
                return(null);
            }

            var coordinates = Coordinates.ParseCoordinates(input);

            if (coordinates != null)
            {
                var address = LocationsHelper.GetAddress(coordinates);
                if (address != null)
                {
                    return(ProcessingResult.CreateReply(message, address));
                }
            }
            else
            {
                try
                {
                    if (message.Parameter == null)
                    {
                        return(null);
                    }
                    var cords = LocationsHelper.GetCoordinates(message.Parameter);
                    if (cords != null)
                    {
                        return(ProcessingResult.CreateHtml(message, cords));
                    }
                }
                catch (Exception ex)
                {
                    Log.New(ex);
                }
            }

            return(null);
        }
Ejemplo n.º 7
0
        public static void DisableMoveMode()
        {
            IsTravelModeEnabled = !IsTravelModeEnabled;

            mainActionButtons.ForEach(_ => _.Enable());
            var b = mainActionButtons.First(_ => _.ActionType == ActionType.Travel);

            b.Text = "Travel";

            foreach (var item in _MainForm.Instance.LocationCardsPanel.LocationCards)
            {
                var l = LocationsHelper.GetLCControl(item.LocationNumber);
                if (l.LocationActionBtn.Visible)
                {
                    l.LocationActionBtn.Hide();
                    l.LocationActionBtn.Click -= MoveClick;
                }
            }

            _MainForm.Instance.Refresh();
        }
Ejemplo n.º 8
0
 public void AddLocationCardToMap(int locationNumber, int alsoActivateMenhirWithValue = -1)
 {
     AddLocationCardToMap(LocationsHelper.GetLCControl(locationNumber), alsoActivateMenhirWithValue);
 }