public ColecoVisionControllerDeck(string controller1Name, string controller2Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);;

            Definition = new ControllerDefinition
            {
                Name        = "ColecoVision Basic Controller",
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .ToList()
            };

            Definition.FloatControls.AddRange(Port1.Definition.FloatControls);
            Definition.FloatControls.AddRange(Port2.Definition.FloatControls);

            Definition.FloatRanges.AddRange(Port1.Definition.FloatRanges);
            Definition.FloatRanges.AddRange(Port2.Definition.FloatRanges);
        }
Пример #2
0
        public GBHawkLink3xControllerDeck(string controller1Name, string controller2Name, string controller3Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller3Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller3Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);
            Port3 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller3Name], 3);

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(Port3.Definition.BoolButtons)
                              .Concat(new[] { "Toggle Cable LC" })
                              .Concat(new[] { "Toggle Cable CR" })
                              .Concat(new[] { "Toggle Cable RL" })
                              .ToList()
            };
        }
        public VectrexHawkControllerDeck(string controller1Name, string controller2Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power",
                    "Reset"
                })
                              .ToList()
            };

            Definition.AxisControls.AddRange(Port1.Definition.AxisControls);
            Definition.AxisControls.AddRange(Port2.Definition.AxisControls);

            Definition.AxisRanges.AddRange(Port1.Definition.AxisRanges);
            Definition.AxisRanges.AddRange(Port2.Definition.AxisRanges);
        }
Пример #4
0
        public A7800HawkControllerDeck(string controller1Name, string controller2Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power",
                    "Reset",
                    "Select",
                    "BW",
                    "Toggle Left Difficulty",                             // better not put P# on these as they might not correspond to player numbers
                    "Toggle Right Difficulty",
                    "Pause"
                })
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
            foreach (var kvp in Port2.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
        }
Пример #5
0
        public GBHawkControllerDeck(string controller1Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .ToList()
            };

            Definition.AxisControls.AddRange(Port1.Definition.AxisControls);

            Definition.AxisRanges.AddRange(Port1.Definition.AxisRanges);
        }
Пример #6
0
        public O2HawkControllerDeck(string controller1Name, string controller2Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "0", "1", "2", "3", "4", "5", "6", "7",
                    "8", "9", "SPC", "?", "L", "P",
                    "+", "W", "E", "R", "T", "U", "I", "O",
                    "Q", "S", "D", "F", "G", "H", "J", "K",
                    "A", "Z", "X", "C", "V", "B", "M", "PERIOD",
                    "-", "*", "/", "=", "YES", "NO", "CLR", "ENT",
                    "Reset", "Power"
                })
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
        }
Пример #7
0
        public A7800HawkControllerDeck(string controller1Name, string controller2Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);

            Definition = new ControllerDefinition
            {
                Name        = "A7800 Controller",
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power",
                    "Reset",
                    "Select",
                    "BW",                             // should be "Color"??
                    "Left Difficulty",                // better not put P# on these as they might not correspond to player numbers
                    "Right Difficulty"
                })
                              .ToList()
            };

            Definition.FloatControls.AddRange(Port1.Definition.FloatControls);
            Definition.FloatControls.AddRange(Port2.Definition.FloatControls);

            Definition.FloatRanges.AddRange(Port1.Definition.FloatRanges);
            Definition.FloatRanges.AddRange(Port2.Definition.FloatRanges);
        }
Пример #8
0
        public IntellivisionControllerDeck(string controller1Name, string controller2Name)
        {
            if (!ValidControllerTypes.ContainsKey(controller1Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller1Name);
            }

            if (!ValidControllerTypes.ContainsKey(controller2Name))
            {
                throw new InvalidOperationException("Invalid controller type: " + controller2Name);
            }

            Port1 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller1Name], 1);
            Port2 = (IPort)Activator.CreateInstance(ValidControllerTypes[controller2Name], 2);

            Definition = new ControllerDefinition
            {
                Name        = "Intellivision Controller",
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power",
                    "Reset"
                })
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
            foreach (var kvp in Port2.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
        }