Beispiel #1
0
        private void InputHistory_InputAdded()
        {
            HistoricalInput historical = InputHistory.History.Last();

            if (historical.OrderedToTile && historical.OrderPoint2D != null)
            {
                foreach (Selectable item in InputHistory.Selected)
                {
                    this.Move(item, historical.OrderPoint2D);
                }
            }
        }
Beispiel #2
0
        private void InputHistory_InputAdded()
        {
            HistoricalInput historical = InputHistory.History.Last();

            if (historical.ActionSelected == ActionSelected.None && historical.OrderedToTile && historical.OrderPoint2D != null)
            {
                foreach (HasComponents item in InputHistory.Selected)
                {
                    this.Move(item, historical.OrderPoint2D);
                }
            }
        }
Beispiel #3
0
        private void InputHistory_InputAdded()
        {
            HistoricalInput historical = InputHistory.History.Last();

            if (historical.ActionSelected == ActionSelected.None && historical.Selected.Count == 1)
            {
                Point2D mapLocation = historical.Selected[0].MapLocation;
                Living  creature    = WorldUtil.GetCreature(mapLocation, RenderInfo.Dimension);

                if (creature != null)
                {
                    CharacterMenu.Initialize(creature);
                }
            }
        }
        private void InputHistory_InputAdded()
        {
            HistoricalInput last = InputHistory.History.Last();

            if (last.ActionSelected == ActionSelected.Mine)
            {
                foreach (MagicalLifeAPI.GUI.Selectable item in last.Selected)
                {
                    Tile tile = World.GetTile(RenderInfo.Dimension, item.MapLocation.X, item.MapLocation.Y);

                    if (tile.Resources != null && tile.ImpendingAction == ActionSelected.None)
                    {
                        MineTask task = new MineTask(tile.MapLocation, Guid.NewGuid());
                        tile.ImpendingAction = ActionSelected.Mine;
                        TaskManager.Manager.AddTask(task);
                    }
                }
            }
        }
        private void InputHistory_InputAdded()
        {
            HistoricalInput last = InputHistory.History.Last();

            if (last.ActionSelected == ActionSelected.Mine)
            {
                foreach (MagicalLifeAPI.GUI.Selectable item in last.Selected)
                {
                    Tile tile = World.GetTile(RenderingPipe.Dimension, item.MapLocation.X, item.MapLocation.Y);

                    if (tile.Resources != null)
                    {
                        MineJob job = new MineJob(tile.MapLocation);
                        tile.ImpendingAction = ActionSelected.Mine;
                        ClientSendRecieve.Send(new JobCreatedMessage(job));
                    }
                }
            }
        }
Beispiel #6
0
        private void InputHistory_InputAdded()
        {
            HistoricalInput last = InputHistory.History.Last();

            if (last.ActionSelected == ActionSelected.Till)
            {
                foreach (HasComponents item in last.Selected)
                {
                    ComponentSelectable selected = item.GetExactComponent <ComponentSelectable>();
                    Tile tile = World.GetTile(RenderInfo.Dimension, selected.MapLocation.X, selected.MapLocation.Y);

                    if (tile.HasComponent <ComponentTillable>() &&
                        tile.ImpendingAction == ActionSelected.None &&
                        tile.MainObject == null)
                    {
                        TillTask task = new TillTask(tile.GetExactComponent <ComponentSelectable>().MapLocation, Guid.NewGuid(), RenderInfo.Dimension);
                        tile.ImpendingAction = ActionSelected.Till;
                        TaskManager.Manager.AddTask(task);
                    }
                }
            }
        }
Beispiel #7
0
        private void InputHistory_InputAdded()
        {
            HistoricalInput last = InputHistory.History.Last();

            if (last.ActionSelected == ActionSelected.Mine)
            {
                foreach (HasComponents item in last.Selected)
                {
                    ComponentSelectable selectable = item.GetExactComponent <ComponentSelectable>();
                    Tile tile = World.GetTile(RenderInfo.Dimension, selectable.MapLocation.X, selectable.MapLocation.Y);

                    if (tile.MainObject != null && tile.ImpendingAction == ActionSelected.None)
                    {
                        if (tile.MainObject is RockBase)
                        {
                            HarvestTask task = new HarvestTask(selectable.MapLocation, Guid.NewGuid());
                            tile.ImpendingAction = ActionSelected.Mine;
                            TaskManager.Manager.AddTask(task);
                        }
                    }
                }
            }
        }