예제 #1
0
        /// <summary>
        /// Handles the specified command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <returns></returns>
        public async Task <ScenarioAsset> Handle(AddScenarioAssetCommand command)
        {
            Procedure procedure = await this._repository.Get(command.ProcedureId);

            ScenarioAsset scenarioAsset = procedure.AddScenarioAsset(command.ScenarioId, command.Tag, command.Position.ToVector(),
                                                                     command.Rotation.ToVector(), command.Scale.ToVector());

            await this._repository.Update(procedure);

            this._eventBus.Publish(new ScenarioAssetAddedEvent(command.ProcedureId, command.ScenarioId, command.Tag, command.Position, command.Rotation, command.Scale));

            return(scenarioAsset);
        }