Exemplo n.º 1
0
        public AdhocNPCGoal(ILogger logger, ConfigurableInput input, AddonReader addonReader, IPlayerDirection playerDirection, StopMoving stopMoving, NpcNameTargeting npcNameTargeting, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, KeyAction key, IBlacklist blacklist, MountHandler mountHandler, Wait wait, ExecGameCommand exec)
        {
            this.logger           = logger;
            this.input            = input;
            this.addonReader      = addonReader;
            this.playerReader     = addonReader.PlayerReader;
            this.playerDirection  = playerDirection;
            this.stopMoving       = stopMoving;
            this.npcNameTargeting = npcNameTargeting;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.key          = key;
            this.blacklist    = blacklist;
            this.mountHandler = mountHandler;

            this.wait            = wait;
            this.execGameCommand = exec;
            this.gossipReader    = addonReader.GossipReader;

            if (key.InCombat == "false")
            {
                AddPrecondition(GoapKey.incombat, false);
            }
            else if (key.InCombat == "true")
            {
                AddPrecondition(GoapKey.incombat, true);
            }

            this.Keys.Add(key);
        }
Exemplo n.º 2
0
 public GoalThread(ILogger logger, ConfigurableInput input, PlayerReader playerReader, GoapAgent goapAgent)
 {
     this.logger       = logger;
     this.input        = input;
     this.playerReader = playerReader;
     this.goapAgent    = goapAgent;
 }
Exemplo n.º 3
0
        private void AddDeviceToDeviceList(ConfigurableInput inputDevice)
        {
            bool foundReplacement = false;

            for (int i = 0; i < devices.Count; i++)
            {
                if (devices[i].DeviceInstanceId == inputDevice.DeviceInstanceId)
                {
                    inputDevice.CopyMappingFrom(devices[i]);
                    devices[i] = inputDevice;

                    foundReplacement = true;
                    break;
                }
            }

            if (!foundReplacement)
            {
                devices.Add(inputDevice);

                ComboBoxItem newItem = new ComboBoxItem();
                newItem.Content = inputDevice.DeviceName;
                comboBoxDevices.Items.Add(newItem);
            }
        }
Exemplo n.º 4
0
        public AdhocNPCGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, IPlayerDirection playerDirection, StopMoving stopMoving, NpcNameFinder npcNameFinder, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, KeyAction key, IBlacklist blacklist)
        {
            this.logger          = logger;
            this.input           = input;
            this.playerReader    = playerReader;
            this.playerDirection = playerDirection;
            this.stopMoving      = stopMoving;
            this.npcNameFinder   = npcNameFinder;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.key       = key;
            this.blacklist = blacklist;

            if (key.InCombat == "false")
            {
                AddPrecondition(GoapKey.incombat, false);
            }
            else if (key.InCombat == "true")
            {
                AddPrecondition(GoapKey.incombat, true);
            }

            this.Keys.Add(key);
        }
Exemplo n.º 5
0
        private void ChangeInputDevice()
        {
            object comboBoxContent = ((ComboBoxItem)comboBoxDevices.SelectedValue).Content;

            if (comboBoxContent != null)
            {
                RemoveSelectedButNotPresentDevice();
                SetMappingEnabledState(true);

                String selectedDeviceName = comboBoxContent.ToString();

                for (int i = 0; i < devices.Count; i++)
                {
                    if (devices[i].DeviceName == selectedDeviceName)
                    {
                        selectedDevice = devices[i];
                    }
                }

                if (selectedDevice != null)
                {
                    CreateControlsForSelectedDevice();
                    TakeOverMapping(((ConfigurableInput)selectedDevice).Mapping);
                    isSelectedDevicePresent = true;
                    UpdateCurrentDeviceDescription();
                }
            }
        }
        public FollowRouteGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, IPlayerDirection playerDirection, List <WowPoint> points, StopMoving stopMoving, NpcNameFinder npcNameFinder, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, MountHandler mountHandler, TargetFinder targetFinder)
        {
            this.logger = logger;
            this.input  = input;

            this.wait            = wait;
            this.addonReader     = addonReader;
            this.playerReader    = addonReader.PlayerReader;
            this.playerDirection = playerDirection;
            this.stopMoving      = stopMoving;

            this.pointsList = points;

            this.npcNameFinder = npcNameFinder;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.mountHandler       = mountHandler;
            this.targetFinder       = targetFinder;

            MinDistance = !(pather is RemotePathingAPIV3) ? 15 : 8;

            if (classConfiguration.Mode != Mode.AttendedGather)
            {
                AddPrecondition(GoapKey.incombat, false);
                AddPrecondition(GoapKey.producedcorpse, false);
                AddPrecondition(GoapKey.consumecorpse, false);
            }
        }
        public LastTargetLoot(ILogger logger, ConfigurableInput input, PlayerReader playerReader, ClassConfiguration classConfiguration)
        {
            this.logger       = logger;
            this.input        = input;
            this.playerReader = playerReader;

            this.classConfiguration = classConfiguration;
        }
        public TargetLastDeadGoal(ILogger logger, ConfigurableInput input)
        {
            this.logger = logger;
            this.input  = input;

            AddPrecondition(GoapKey.hastarget, false);
            AddPrecondition(GoapKey.producedcorpse, true);
        }
 public WrongZoneGoal(PlayerReader playerReader, ConfigurableInput input, IPlayerDirection playerDirection, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
 {
     this.playerReader       = playerReader;
     this.input              = input;
     this.playerDirection    = playerDirection;
     this.logger             = logger;
     this.stuckDetector      = stuckDetector;
     this.classConfiguration = classConfiguration;
     AddPrecondition(GoapKey.incombat, false);
 }
Exemplo n.º 10
0
        public TargetFinder(ILogger logger, ConfigurableInput input, ClassConfiguration classConfig, Wait wait, PlayerReader playerReader, IBlacklist blacklist, NpcNameTargeting npcNameTargeting)
        {
            this.logger       = logger;
            this.classConfig  = classConfig;
            this.input        = input;
            this.wait         = wait;
            this.playerReader = playerReader;

            this.blacklist        = blacklist;
            this.npcNameTargeting = npcNameTargeting;
        }
Exemplo n.º 11
0
        public CastingHandler(ILogger logger, ConfigurableInput input, PlayerReader playerReader, ClassConfiguration classConfig, IPlayerDirection direction, NpcNameFinder npcNameFinder)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader = playerReader;

            this.classConfig   = classConfig;
            this.direction     = direction;
            this.npcNameFinder = npcNameFinder;
        }
        public TargetPetTarget(ConfigurableInput input, PlayerReader playerReader)
        {
            this.input        = input;
            this.playerReader = playerReader;

            AddPrecondition(GoapKey.incombat, true);
            AddPrecondition(GoapKey.hastarget, false);
            AddPrecondition(GoapKey.pethastarget, true);

            AddEffect(GoapKey.hastarget, true);
        }
Exemplo n.º 13
0
        public LastTargetLoot(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, CombatUtil combatUtil)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.playerReader = addonReader.PlayerReader;
            this.stopMoving   = stopMoving;
            this.bagReader    = addonReader.BagReader;

            this.combatUtil = combatUtil;
        }
Exemplo n.º 14
0
        public CorpseRunGoal(PlayerReader playerReader, ConfigurableInput input, IPlayerDirection playerDirection, List <WowPoint> spiritWalker, StopMoving stopMoving, ILogger logger, StuckDetector stuckDetector)
        {
            this.playerReader     = playerReader;
            this.input            = input;
            this.playerDirection  = playerDirection;
            this.stopMoving       = stopMoving;
            this.spiritWalkerPath = spiritWalker.ToList();
            this.logger           = logger;
            this.stuckDetector    = stuckDetector;

            AddPrecondition(GoapKey.isdead, true);
        }
Exemplo n.º 15
0
        public LootGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, BagReader bagReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameFinder npcNameFinder)
        {
            this.logger       = logger;
            this.input        = input;
            this.playerReader = playerReader;
            this.stopMoving   = stopMoving;
            this.bagReader    = bagReader;

            this.classConfiguration = classConfiguration;
            this.npcNameFinder      = npcNameFinder;

            outOfCombat = playerReader.PlayerBitValues.PlayerInCombat;
        }
Exemplo n.º 16
0
        public ParallelGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, StopMoving stopMoving, List <KeyAction> keysConfig, CastingHandler castingHandler)
        {
            this.logger = logger;
            this.input  = input;

            this.stopMoving   = stopMoving;
            this.playerReader = playerReader;

            this.castingHandler = castingHandler;

            AddPrecondition(GoapKey.incombat, false);

            keysConfig.ForEach(key => this.Keys.Add(key));
        }
        public CastingHandler(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, ClassConfiguration classConfig, IPlayerDirection direction, NpcNameFinder npcNameFinder, StopMoving stopMoving)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.addonReader  = addonReader;
            this.playerReader = addonReader.PlayerReader;

            this.classConfig   = classConfig;
            this.direction     = direction;
            this.npcNameFinder = npcNameFinder;
            this.stopMoving    = stopMoving;
        }
Exemplo n.º 18
0
        private void HandleNewDevice(String deviceId, ConfigurableInput inputDevice)
        {
            AddDeviceToDeviceList(inputDevice);

            if (selectedDevice != null && selectedDevice.DeviceInstanceId == inputDevice.DeviceInstanceId)
            {
                inputDevice.CopyMappingFrom(selectedDevice);

                selectedDevice = inputDevice;

                isSelectedDevicePresent = true;
                UpdateCurrentDeviceDescription();
            }
        }
Exemplo n.º 19
0
        public GoapAgent(ILogger logger, WowProcess wowProcess, ConfigurableInput input, PlayerReader playerReader, HashSet <GoapGoal> availableGoals, IBlacklist blacklist, ClassConfiguration classConfiguration, BagReader bagReader)
        {
            this.logger     = logger;
            this.wowProcess = wowProcess;
            this.input      = input;

            this.playerReader   = playerReader;
            this.AvailableGoals = availableGoals.OrderBy(a => a.CostOfPerformingAction);
            this.blacklist      = blacklist;

            this.planner            = new GoapPlanner(logger);
            this.classConfiguration = classConfiguration;
            this.bagReader          = bagReader;
        }
Exemplo n.º 20
0
        private ConfigurableInput GetDeviceById(String deviceId)
        {
            ConfigurableInput input = null;

            for (int i = 0; i < devices.Count; i++)
            {
                if (devices[i].DeviceInstanceId == deviceId)
                {
                    input = devices[i];
                    break;
                }
            }

            return(input);
        }
Exemplo n.º 21
0
	// Use this for initialization
	void Start() {
		audioSource = GetComponent<AudioSource>();
		InputHandler = ConfigurableInput.Instance;
		InputHandler.SetKey("Up", UpKey, KeyCode.None, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Down", DownKey, KeyCode.None, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Left", LeftKey, KeyCode.None, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Right", RightKey, KeyCode.None, KeyCode.None, KeyCode.None);

		InputHandler.SetPrimaryKeyAsAxis("JoyUp", "Joy1 Axis 2-", 0, 0.2f);
		InputHandler.SetPrimaryKeyAsAxis("JoyDown", "Joy1 Axis 2+", 0, 0.2f);
		InputHandler.SetAxis("Vertical", "JoyUp", "JoyDown");
		InputHandler.SetPrimaryKeyAsAxis("JoyLeft", "Joy1 Axis 1-", 0, 0.2f);
		InputHandler.SetPrimaryKeyAsAxis("JoyRight", "Joy1 Axis 1+", 0, 0.2f);
		InputHandler.SetAxis("Horizontal", "JoyLeft", "JoyRight");
	}
Exemplo n.º 22
0
        public LootGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameTargeting npcNameTargeting, CombatUtil combatUtil)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.playerReader = addonReader.PlayerReader;
            this.areaDb       = addonReader.AreaDb;
            this.stopMoving   = stopMoving;
            this.bagReader    = addonReader.BagReader;

            this.classConfiguration = classConfiguration;
            this.npcNameTargeting   = npcNameTargeting;
            this.combatUtil         = combatUtil;
        }
        public ApproachTargetGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, StopMoving stopMoving, StuckDetector stuckDetector)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader = playerReader;
            this.stopMoving   = stopMoving;

            this.stuckDetector = stuckDetector;

            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.targetisalive, true);
            AddPrecondition(GoapKey.incombatrange, false);

            AddEffect(GoapKey.incombatrange, true);
        }
        public WalkToCorpseGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, IPlayerDirection playerDirection, List <WowPoint> spiritWalker, List <WowPoint> routePoints, StopMoving stopMoving, StuckDetector stuckDetector, IPPather pather)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader     = playerReader;
            this.playerDirection  = playerDirection;
            this.stopMoving       = stopMoving;
            this.routePoints      = routePoints.ToList();
            this.spiritWalkerPath = spiritWalker.ToList();

            this.stuckDetector = stuckDetector;
            this.pather        = pather;

            AddPrecondition(GoapKey.isdead, true);
        }
Exemplo n.º 25
0
        private void RemoveDeviceFromDeviceList(String deviceId)
        {
            ConfigurableInput inputDevice = GetDeviceById(deviceId);

            if (inputDevice != null)
            {
                devices.Remove(inputDevice);

                for (int i = 0; i < comboBoxDevices.Items.Count; i++)
                {
                    if (((ComboBoxItem)(comboBoxDevices.Items[i])).Content.ToString() == inputDevice.DeviceName)
                    {
                        comboBoxDevices.Items.RemoveAt(i);
                        break;
                    }
                }
            }
        }
Exemplo n.º 26
0
	// Use this for initialization
	void Start () {
		InputHandler = ConfigurableInput.Instance;
		InputHandler.SetKey("Up", KeyCode.W, KeyCode.UpArrow, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Down", KeyCode.S, KeyCode.DownArrow, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Left", KeyCode.A, KeyCode.LeftArrow, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Right", KeyCode.D, KeyCode.RightArrow, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Run Up", KeyCode.W, KeyCode.UpArrow, KeyCode.LeftShift, KeyCode.LeftShift);
		InputHandler.SetKey("Run Down", KeyCode.S, KeyCode.DownArrow, KeyCode.LeftShift, KeyCode.LeftShift);
		InputHandler.SetKey("Run Down2", KeyCode.S, KeyCode.DownArrow, KeyCode.LeftControl, KeyCode.LeftControl);
		InputHandler.SetKey("Run Left", KeyCode.A, KeyCode.LeftArrow, KeyCode.LeftShift, KeyCode.LeftShift);
		InputHandler.SetKey("Shift", KeyCode.LeftShift, KeyCode.None, KeyCode.None, KeyCode.None);
		InputHandler.SetKey("Run Right", KeyCode.D, KeyCode.RightArrow, KeyCode.LeftShift, KeyCode.LeftShift);
		//InputHandler.SetPrimaryKeyAsAxis("Up", "Joy1 Axis 2-", KeyCode.LeftShift, 0.2f);
		//InputHandler.SetPrimaryKeyAsAxis("Down", "Joy1 Axis 2+", KeyCode.LeftShift, 0.2f);
		InputHandler.SetAxis("Vertical", "Up", "Down");
		InputHandler.OnAxisScanned += AxisScanned;
		InputHandler.OnKeyScanned += KeyScanned;
	}
Exemplo n.º 27
0
        public SkinningGoal(ILogger logger, ConfigurableInput input, AddonReader addonReader, Wait wait, StopMoving stopMoving, NpcNameTargeting npcNameTargeting, CombatUtil combatUtil)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader    = addonReader.PlayerReader;
            this.wait            = wait;
            this.stopMoving      = stopMoving;
            this.bagReader       = addonReader.BagReader;
            this.equipmentReader = addonReader.EquipmentReader;

            this.npcNameTargeting = npcNameTargeting;
            this.combatUtil       = combatUtil;

            AddPrecondition(GoapKey.incombat, false);
            AddPrecondition(GoapKey.shouldskin, true);

            AddEffect(GoapKey.shouldskin, false);
        }
Exemplo n.º 28
0
        public GoapAgent(ILogger logger, GoapAgentState goapAgentState, ConfigurableInput input, AddonReader addonReader, HashSet <GoapGoal> availableGoals, IBlacklist blacklist)
        {
            this.logger         = logger;
            this.GoapAgentState = goapAgentState;
            this.input          = input;

            this.addonReader  = addonReader;
            this.playerReader = addonReader.PlayerReader;

            this.addonReader.CreatureHistory.KillCredit -= OnKillCredit;
            this.addonReader.CreatureHistory.KillCredit += OnKillCredit;

            this.stopMoving = new StopMoving(input, playerReader);

            this.AvailableGoals = availableGoals.OrderBy(a => a.CostOfPerformingAction);
            this.blacklist      = blacklist;

            this.planner = new GoapPlanner(logger);
        }
Exemplo n.º 29
0
        public AdhocGoal(ILogger logger, ConfigurableInput input, KeyAction key, PlayerReader playerReader, StopMoving stopMoving, CastingHandler castingHandler)
        {
            this.logger         = logger;
            this.input          = input;
            this.stopMoving     = stopMoving;
            this.playerReader   = playerReader;
            this.key            = key;
            this.castingHandler = castingHandler;

            if (key.InCombat == "false")
            {
                AddPrecondition(GoapKey.incombat, false);
            }
            else if (key.InCombat == "true")
            {
                AddPrecondition(GoapKey.incombat, true);
            }

            this.Keys.Add(key);
        }
        public ApproachTargetGoal(ILogger logger, ConfigurableInput input, Wait wait, PlayerReader playerReader, StopMoving stopMoving)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.playerReader = playerReader;
            this.stopMoving   = stopMoving;

            lastPlayerDistance = 0;
            lastPlayerLocation = playerReader.PlayerLocation;

            initialTargetGuid = playerReader.TargetGuid;
            initialMinRange   = 0;

            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.targetisalive, true);
            AddPrecondition(GoapKey.incombatrange, false);

            AddEffect(GoapKey.incombatrange, true);
        }
Exemplo n.º 31
0
        public SkinningGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, BagReader bagReader, EquipmentReader equipmentReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameFinder npcNameFinder)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader    = playerReader;
            this.stopMoving      = stopMoving;
            this.bagReader       = bagReader;
            this.equipmentReader = equipmentReader;


            this.classConfiguration = classConfiguration;
            this.npcNameFinder      = npcNameFinder;

            AddPrecondition(GoapKey.incombat, false);
            AddPrecondition(GoapKey.shouldskin, true);

            AddEffect(GoapKey.shouldskin, false);

            outOfCombat = playerReader.PlayerBitValues.PlayerInCombat;
        }
Exemplo n.º 32
0
        public PullTargetGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, NpcNameFinder npcNameFinder, StopMoving stopMoving, CastingHandler castingHandler, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader  = playerReader;
            this.npcNameFinder = npcNameFinder;
            this.stopMoving    = stopMoving;

            this.castingHandler     = castingHandler;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;

            AddPrecondition(GoapKey.incombat, false);
            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.pulled, false);
            AddPrecondition(GoapKey.withinpullrange, true);
            AddPrecondition(GoapKey.isswimming, false);
            AddEffect(GoapKey.pulled, true);

            this.classConfiguration.Pull.Sequence.Where(k => k != null).ToList().ForEach(key => this.Keys.Add(key));
        }
Exemplo n.º 33
0
	// Use this for initialization
	void Start () {
		InputHandler = ConfigurableInput.Instance;
		pickupper = GetComponent<Pickupper>();
	}
Exemplo n.º 34
0
 void Start() {
     _input = ConfigurableInput.GetInstance();
     _placement = ItemPlacement.GetInstance();
 }
Exemplo n.º 35
0
	// Use this for initialization
	void Start () {
		InputHandler = ConfigurableInput.Instance;
		InputHandler.SetKey("Action", ActionKey, ActionKey2, KeyCode.None, KeyCode.None);
	}
Exemplo n.º 36
0
	void Awake(){
		NrOfKeyCodes = Enum.GetValues(typeof(KeyCode)).Length;
		//NrOfKeyCodes = 450;
		if (Instance == null) {
			Instance = this;
		}else{
			throw new System.InvalidOperationException("Can not have multiple instances of ConfigurableInput");
		}
		MapEntries = new Dictionary<string, InputMapEntry>();
		Modifiers = new Dictionary<KeyCode, int>();
		ModifiedKeys = new List<KeyCode>();
        ModifierKeys = new List<KeyCode>();
		ModifiedAxes = new List<string>();
		AxisEntries = new Dictionary<string, InputAxisEntry>();
		InitAxes();
	}