private void AddThirdPersonLeftMouseClickActionsToResult(List <PlayerAction.Action> result, MouseState currentMouseState)
        {
            Vector3 nearPoint = Player.getPlayerAimingAtPointAtDistance(0, currentMouseState);
            Vector3 farPoint  = Player.getPlayerAimingAtPointAtDistance(1, currentMouseState);

            switch (currentInterfaceState)
            {
            case InterfaceStates.playing:
                if (timeSinceLastLeftClick > doubleLeftClickInterval)
                {
                    timeSinceLastLeftClick = 0;
                    result.Add(new PlayerAction.LeftClick(nearPoint,
                                                          farPoint));
                }
                else
                {
                    result.Add(new PlayerAction.DoubleClick(nearPoint,
                                                            farPoint));
                }
                break;

            case InterfaceStates.inMainMenu:
                break;

            case InterfaceStates.placingBoat:
                result.Add(new PlayerAction.BoatPlacement(nearPoint, farPoint));
                break;

            case InterfaceStates.placingCharacter:
                result.Add(new PlayerAction.CharacterPlacement(nearPoint, farPoint));
                break;

            case InterfaceStates.placingFarm:
                result.Add(new PlayerAction.StartDragging(nearPoint, farPoint, PlayerAction.Dragging.DragType.farm));
                break;

            case InterfaceStates.placingExcavation:
                result.Add(new PlayerAction.StartDragging(nearPoint, farPoint, PlayerAction.Dragging.DragType.excavate));
                break;

            case InterfaceStates.placingWoodPlanBlocks:
                result.Add(new PlayerAction.RemoveWoodBlockPlan(nearPoint, farPoint));
                break;

            case InterfaceStates.placingWoodStorage:
                PlayerAction.Dragging.DragType dragType = PlayerAction.Dragging.DragType.storeWood;
                result.Add(new PlayerAction.StartDragging(nearPoint, farPoint, dragType));
                break;

            case InterfaceStates.placingWheatStorage:
                PlayerAction.Dragging.DragType dragWheat = PlayerAction.Dragging.DragType.storeWheat;
                result.Add(new PlayerAction.StartDragging(nearPoint, farPoint, dragWheat));
                break;

            case InterfaceStates.placingStoneStorage:
                PlayerAction.Dragging.DragType dragStone = PlayerAction.Dragging.DragType.storeStone;
                result.Add(new PlayerAction.StartDragging(nearPoint, farPoint, dragStone));
                break;
            }
        }
Beispiel #2
0
        internal void addPlayerDraggedJobsiteWithBlocks(List <BlockLoc> blocksToAdd, IslandPathingProfile profile,
                                                        PlayerAction.Dragging.DragType dragType)
        {
            /// blocksToAdd = alreadyOccupied;

            switch (dragType)
            {
            case PlayerAction.Dragging.DragType.farm:
                placeFarmWithBlocks(blocksToAdd, profile);
                break;

            case PlayerAction.Dragging.DragType.storeWheat:
                placeStorageAreaWithBlocksToPlaceOn(blocksToAdd, profile, ResourceBlock.ResourceType.Wheat);
                break;

            case PlayerAction.Dragging.DragType.storeWood:
                placeStorageAreaWithBlocksToPlaceOn(blocksToAdd, profile, ResourceBlock.ResourceType.Wood);
                break;

            case PlayerAction.Dragging.DragType.storeStone:
                placeStorageAreaWithBlocksToPlaceOn(blocksToAdd, profile, ResourceBlock.ResourceType.standardBlock);
                break;

            case PlayerAction.Dragging.DragType.excavate:
                foreach (BlockLoc test in blocksToAdd)
                {
                    addExcavationMark(test, workingProfile.getPathingProfile());
                }
                break;
            }
        }
Beispiel #3
0
 public void addPlayerDraggedJobsiteWithBlocks(List <BlockLoc> blocksToAdd, PlayerAction.Dragging.DragType dragType)
 {
     jobSiteManager.addPlayerDraggedJobsiteWithBlocks(blocksToAdd, getPathingProfile(), dragType);
 }
Beispiel #4
0
 public void handlePlayerFinishDrag(Vector3 addedFrom, List <BlockLoc> blocksToAdd, PlayerAction.Dragging.DragType dragType)
 {
     islandManager.getClosestIslandToLocation(addedFrom).addPlayerDraggedJobsiteWithBlocks(blocksToAdd, dragType);
 }