public EditorGameRecoveryService([NotNull] GameEditorViewModel editor) { if (editor == null) { throw new ArgumentNullException(nameof(editor)); } this.editor = editor; }
protected override DriverResult Editor(GamePart part, IUpdateModel updater, dynamic shapeHelper) { var viewModel = new GameEditorViewModel(); updater.TryUpdateModel(viewModel, Prefix, null, null); _gameService.Value.UpdateGame(viewModel, part); return(Editor(part, shapeHelper)); }
public EditorGameGraphicsCompositorService([NotNull] IEditorGameController controller, [NotNull] GameEditorViewModel editor) { if (controller == null) { throw new ArgumentNullException(nameof(controller)); } if (editor == null) { throw new ArgumentNullException(nameof(editor)); } this.controller = controller; this.editor = editor; settingsProvider = editor.ServiceProvider.Get <GameSettingsProviderService>(); }
/// <summary> /// Initializes a new instance of the <see cref="EditorGameController{TEditorGame}"/> class. /// </summary> /// <param name="asset">The asset associated with this instance.</param> /// <param name="editor">The editor associated with this instance.</param> /// <param name="gameFactory">The factory to create the editor game.</param> protected EditorGameController([NotNull] AssetViewModel asset, [NotNull] GameEditorViewModel editor, [NotNull] EditorGameFactory <TEditorGame> gameFactory) { if (asset == null) { throw new ArgumentNullException(nameof(asset)); } if (editor == null) { throw new ArgumentNullException(nameof(editor)); } Asset = asset; Editor = editor; GameSideNodeContainer = new SessionNodeContainer(asset.Session) { NodeBuilder = { NodeFactory = new AssetNodeFactory() } }; //Logger = GlobalLogger.GetLogger("Scene"); Logger = new LoggerResult(); debugPage = EditorDebugTools.CreateLogDebugPage(Logger, "Scene"); // Create the game var builderService = asset.ServiceProvider.Get <GameStudioBuilderService>(); Game = gameFactory(gameContentLoadedTaskSource, builderService.EffectCompiler, builderService.EffectLogPath); Game.PackageSettings = asset.ServiceProvider.Get <GameSettingsProviderService>(); sceneGameThread = new Thread(SafeAction.Wrap(SceneGameRunThread)) { IsBackground = true, Name = $"EditorGameThread ({asset.Url})" }; sceneGameThread.SetApartmentState(ApartmentState.STA); Debug = new EditorGameDebugService(); Loader = new EditorContentLoader(this, Logger, asset, Game); }
public GameEditor() { InitializeComponent(); viewModel = new GameEditorViewModel(); this.DataContext = viewModel; }
/// <summary> /// Initializes a new instance of the <see cref="AssetCompositeHierarchyEditorController{TEditorGame,TAssetPartDesign,TAssetPart,TParentViewModel}"/> class. /// </summary> /// <param name="asset">The asset associated with this instance.</param> /// <param name="editor">The editor associated with this instance.</param> /// <param name="gameFactory">The factory to create the editor game.</param> protected AssetCompositeHierarchyEditorController([NotNull] AssetViewModel asset, [NotNull] GameEditorViewModel editor, [NotNull] EditorGameFactory <TEditorGame> gameFactory) : base(asset, editor, gameFactory) { }
public void UpdateGame(GameEditorViewModel viewModel, GamePart gamePart) { gamePart.SortObjectivesByAlphabet = viewModel.SortObjectivesByAlphabet; gamePart.UseTinyDisplayType = viewModel.UseTinyDisplayType; }