Beispiel #1
0
        public DolphinJoyConfig Contains(string serial)
        {
            foreach (DolphinJoyConfig config in joysConfig)
            {
                if (config.serial_number == serial)
                {
                    return(config);
                }
            }

            DolphinJoyConfig instance = new DolphinJoyConfig();

            instance.SetConfig("-1", 0x2009);
            return(instance);
        }
Beispiel #2
0
        public void AddSerial(string serial, ushort id, int force = 10, int x = 1, int y = 1, int z = 1)
        {
            bool found = false;

            for (int i = 0; i < joysConfig.Count; i++)
            {
                if (joysConfig[i].serial_number == serial)
                {
                    DolphinJoyConfig config = joysConfig[i];
                    config.SetConfig(serial, id, force, x, y, z);
                    joysConfig[i] = config;
                    found         = true;
                    break;
                }
            }

            if (!found)
            {
                DolphinJoyConfig instance = new DolphinJoyConfig();
                instance.SetConfig(serial, id, force, x, y, z);
                joysConfig.Add(instance);
            }
        }