//float Scale = 1f; // Start is called before the first frame update void Start() { Debug.Log("Start Game"); Players = new List <string>(); Players.Add("Player One"); Board.LoadBoard(Players); hv = HandViewer.GetComponent <DeckViewer>(); cv = CardViewer.GetComponent <CardViewer>(); files = GetComponent <GetFiles>(); Global.Version = "startrek2e"; Global.ImageHeader = "ImageFile"; Global.NameHeader = "Name"; Global.CurrentPlayer = 0; string update = Global.Root + @"\plugins\" + Global.Version + @"\playable\updatelist.txt"; Global.ImageDir = Global.Root + @"\plugins\" + Global.Version + @"\sets\setimages\general\"; HandViewer.GetComponent <SpriteRenderer>().enabled = false; if (File.Exists(update)) { files.Populate(); StreamReader sr = File.OpenText(update); string line = ""; while (!sr.EndOfStream) { line = sr.ReadLine(); } Global.CardGeneralURLs = line; Global.ImageDir = Global.Root + @"\plugins\" + Global.Version + @"\sets\setimages\general"; } else { files.InitializeFiles( Global.Url, @"plugins/" + Global.Version + @"/" + Global.UpdateDir + @"/updatelist.txt"); } var extensionList = new[] { new ExtensionFilter("Text", "txt"), }; var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", extensionList, false); GameObject PlayField = GameObject.Find("PlayField"); PlayEngine pe = PlayField.GetComponent <PlayEngine>(); pe.Player = Board.GetPlayer(Players[0]); pe.LoadDecks(paths[0]); pe.Init(); }
public override void Start() { // Ensure the play engine exists if (_engine == null) { IScope scope = this.Scope; if (scope != null) { ISchedulingService schedulingService = scope.GetService(typeof(ISchedulingService)) as ISchedulingService; IConsumerService consumerService = scope.GetService(typeof(IConsumerService)) as IConsumerService; IProviderService providerService = scope.GetService(typeof(IProviderService)) as IProviderService; _engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build(); } else { if (log.IsErrorEnabled) { log.Error("Scope was null on start"); } } } // Create bw control service and register myself // Bandwidth control service should not be bound to a specific scope because it's designed to control // the bandwidth system-wide. _bwController = this.Scope.GetService(typeof(IBWControlService)) as IBWControlService; _bwContext = _bwController.RegisterBWControllable(this); //Set bandwidth members on the engine _engine.SetBandwidthController(_bwController, _bwContext); //Set buffer check interval _engine.BufferCheckInterval = _bufferCheckInterval; //Set underrun trigger _engine.UnderrunTrigger = _underrunTrigger; // Start playback engine _engine.Start(); // Notify subscribers on start NotifySubscriberStart(); }
private static void OnEnginePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { Player player = d as Player; if (e.NewValue != null) { PlayEngine engine = e.NewValue as PlayEngine; engine.StateChanged += player.Engine_StateChanged; engine.CurrentChanged += player.Engine_CurrentChanged; engine.DurationChanged += player.Engine_DurationChanged; player.IsAvailable = true; } else { player.IsAvailable = false; } if (e.OldValue != null) { PlayEngine engine = e.OldValue as PlayEngine; engine.StateChanged -= player.Engine_StateChanged; } }
/// <summary> /// Creates a play engine based on current services (scheduling service, consumer service, and provider service). /// </summary> /// <param name="schedulingService">The scheduling service.</param> /// <param name="consumerService">The consumer service.</param> /// <param name="providerService">The provider service.</param> /// <returns>Play engine.</returns> PlayEngine CreateEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) { _engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build(); return(_engine); }