Exemplo n.º 1
0
        public KSPAPI(FormatterProvider formatters, VesselChangeDetector vesselChangeDetector, ServerConfiguration serverConfiguration)
        {
            APIHandlers.Add(new PausedDataLinkHandler(formatters));
            APIHandlers.Add(new FlyByWireDataLinkHandler(formatters));
            APIHandlers.Add(new FlightDataLinkHandler(formatters));
            APIHandlers.Add(new MechJebDataLinkHandler(formatters));
            APIHandlers.Add(new TimeWarpDataLinkHandler(formatters));
            APIHandlers.Add(new TargetDataLinkHandler(formatters));

            APIHandlers.Add(new CompoundDataLinkHandler(
                new List<DataLinkHandler>() {
                    new OrbitDataLinkHandler(formatters),
                    new SensorDataLinkHandler(vesselChangeDetector, formatters),
                    new VesselDataLinkHandler(formatters),
                    new BodyDataLinkHandler(formatters),
                    new ResourceDataLinkHandler(vesselChangeDetector, formatters),
                    new APIDataLinkHandler(this, formatters, serverConfiguration),
                    new NavBallDataLinkHandler(formatters),
                    new MapViewDataLinkHandler(formatters),
                    new DockingDataLinkHandler(formatters)
                    }, formatters
                ));

            APIHandlers.Add(new DefaultDataLinkHandler(formatters));
        }
Exemplo n.º 2
0
        public KSPAPI(FormatterProvider formatters, VesselChangeDetector vesselChangeDetector,
                      ServerConfiguration serverConfiguration, PluginManager manager)
        {
            _manager = manager;

            APIHandlers.Add(new PausedDataLinkHandler(formatters));
            APIHandlers.Add(new FlyByWireDataLinkHandler(formatters));
            APIHandlers.Add(new FlightDataLinkHandler(formatters));
            APIHandlers.Add(new MechJebDataLinkHandler(formatters));
            APIHandlers.Add(new TimeWarpDataLinkHandler(formatters));
            APIHandlers.Add(new TargetDataLinkHandler(formatters));

            APIHandlers.Add(new CompoundDataLinkHandler(
                                new List <DataLinkHandler>()
            {
                new OrbitDataLinkHandler(formatters),
                new SensorDataLinkHandler(vesselChangeDetector, formatters),
                new VesselDataLinkHandler(formatters),
                new BodyDataLinkHandler(formatters),
                new ResourceDataLinkHandler(vesselChangeDetector, formatters),
                new APIDataLinkHandler(this, formatters, serverConfiguration),
                new NavBallDataLinkHandler(formatters),
                new MapViewDataLinkHandler(formatters),
                new DockingDataLinkHandler(formatters)
            }, formatters
                                ));
        }
Exemplo n.º 3
0
 public DummyHandler(FormatterProvider formatters)
     : base(formatters)
 {
     registerAPI(new PlotableAPIEntry(
         dataSources => { return r.NextDouble(); },
         "d.unitless", "Unitless", formatters.Default, APIEntry.UnitType.UNITLESS));
     registerAPI(new PlotableAPIEntry(
         dataSources => { return r.NextDouble(); },
         "d.string", "String", formatters.String, APIEntry.UnitType.STRING));
     registerAPI(new PlotableAPIEntry(
         dataSources => { return r.NextDouble(); },
         "d.run", "String", formatters.Default, APIEntry.UnitType.UNITLESS));
 }
Exemplo n.º 4
0
 public DummyKSPAPI(FormatterProvider formatters, VesselChangeDetector vesselChangeDetector,
     Servers.AsynchronousServer.ServerConfiguration serverConfiguration)
 {
     APIHandlers.Add(new DummyHandler(formatters));
 }
Exemplo n.º 5
0
 public DataLinkResponsibility(FormatterProvider formatters, ServerConfiguration serverConfiguration)
 {
     kspAPI = new KSPAPI(formatters, vesselChangeDetector, serverConfiguration);
 }