public override void Initialize(IComponentManager componentManager) { _editableMeshResolver = componentManager.GetComponent <IEditableMeshResolver>(); _sceneManager = componentManager.GetComponent <SceneManager>(); _selectionManager = componentManager.GetComponent <SelectionManager>(); _resourceLib = componentManager.GetComponent <ResourceLibary>(); }
public EntityManager(IComponentManager componentManager) { entities = new Dictionary <UniqueId, Entity>(); filteredCollections = new Dictionary <int, FilteredCollection>(); components = componentManager; templateCollections = new TemplateCollections(this); }
public BmiViewModel(GameSkeleton skeleton, Rmv2MeshNode meshNode, IComponentManager componentManager) { _componentManager = componentManager; _meshNode = meshNode; _skeleton = skeleton; CreateBoneOverview(_skeleton); }
public IEnumerable <IOperationProvider> Process(IComponentManager componentManager, JObject rawConfiguration, IDirectory templateRoot, IVariableCollection variables, IParameterSet parameters) { IReadOnlyList <string> ifToken = rawConfiguration.ArrayAsStrings("if"); IReadOnlyList <string> elseToken = rawConfiguration.ArrayAsStrings("else"); IReadOnlyList <string> elseIfToken = rawConfiguration.ArrayAsStrings("elseif"); IReadOnlyList <string> actionableIfToken = rawConfiguration.ArrayAsStrings("actionableIf"); IReadOnlyList <string> actionableElseToken = rawConfiguration.ArrayAsStrings("actionableElse"); IReadOnlyList <string> actionableElseIfToken = rawConfiguration.ArrayAsStrings("actionableElseif"); IReadOnlyList <string> actionsToken = rawConfiguration.ArrayAsStrings("actions"); IReadOnlyList <string> endIfToken = rawConfiguration.ArrayAsStrings("endif"); string id = rawConfiguration.ToString("id"); bool trim = rawConfiguration.ToBool("trim"); bool wholeLine = rawConfiguration.ToBool("wholeLine"); string evaluatorName = rawConfiguration.ToString("evaluator"); ConditionEvaluator evaluator = EvaluatorSelector.Select(evaluatorName); ConditionalTokens tokenVariants = new ConditionalTokens { IfTokens = ifToken, ElseTokens = elseToken, ElseIfTokens = elseIfToken, EndIfTokens = endIfToken, ActionableElseIfTokens = actionableElseIfToken, ActionableElseTokens = actionableElseToken, ActionableIfTokens = actionableIfToken, ActionableOperations = actionsToken }; yield return(new Conditional(tokenVariants, wholeLine, trim, evaluator, id)); }
public AuditorSetter(IComponentManager manager, FieldInfo field) { _manager = manager; _member = field; _auditorFunc = GetAuditorFunc(field.FieldType); _setterFunc = field.SetValue; }
internal GlobalRunSpec( IDirectory templateRoot, IComponentManager componentManager, IParameterSet parameters, IVariableCollection variables, IGlobalRunConfig globalConfig, IReadOnlyList <KeyValuePair <string, IGlobalRunConfig> > fileGlobConfigs, IReadOnlyList <string> ignoreFileNames) { EnsureOperationConfigs(componentManager); RootVariableCollection = variables; IgnoreFileNames = ignoreFileNames; Operations = ResolveOperations(globalConfig, templateRoot, variables, parameters); List <KeyValuePair <IPathMatcher, IRunSpec> > specials = new List <KeyValuePair <IPathMatcher, IRunSpec> >(); if (fileGlobConfigs != null) { foreach (KeyValuePair <string, IGlobalRunConfig> specialEntry in fileGlobConfigs) { IReadOnlyList <IOperationProvider> specialOps = null; if (specialEntry.Value != null) { specialOps = ResolveOperations(specialEntry.Value, templateRoot, variables, parameters); } RunSpec spec = new RunSpec(specialOps, specialEntry.Value.VariableSetup.FallbackFormat); specials.Add(new KeyValuePair <IPathMatcher, IRunSpec>(new GlobbingPatternMatcher(specialEntry.Key), spec)); } } Special = specials; }
/// <summary> /// /// </summary> /// <param name="componentManager">componentManager</param> /// <param name="consulSetting">服务发现配置</param> /// <param name="deregisterAction">取消注册委托,当程序关闭或服务下线时,该委托会取消服务注册</param> /// <returns></returns> public static IComponentManager UseConsul(this IComponentManager componentManager, ConsulSetting consulSetting) { _consulSetting = consulSetting; initConsul(componentManager); componentManager.RegisterAssembly(typeof(ComponentManagerExtend).Assembly); return(componentManager); }
private Action GetCommandAction(List <string> args) { UInt32 id; if (args.Count < 1) { _logger.LogError($"Get command requires >= 1 args: either an Entity id or a manager name and Entity id;"); } else if (args.Count == 1) { if (!ValidateId(args[0], out id)) { return(null); } var living = _manager.Alive(id) ? "alive" : "not alive"; _logger.LogInformation($"Entity {args[0]} is {living}"); } else if (args.Count > 1) { IComponentManager manager = _collection.GetManagerByName(args[0]); if (manager == null) { return(null); } if (!ValidateId(args[1], out id)) { return(null); } _logger.LogInformation($"{manager.GetInstance(id)}"); } return(null); }
public IEnumerable <IOperationProvider> Process(IComponentManager componentManager, JObject rawConfiguration, IDirectory templateRoot, IVariableCollection variables, IParameterSet parameters) { EnsureMacros(componentManager); ParameterSetter setter = (p, value) => { ((RunnableProjectGenerator.ParameterSet)parameters).AddParameter(p); parameters.ResolvedValues[p] = value; }; foreach (JProperty property in rawConfiguration.Properties()) { string variableName = property.Name; JObject def = (JObject)property.Value; string macroType = def["type"].ToString(); IMacro macroObject; if (_macros.TryGetValue(macroType, out macroObject)) { macroObject.Evaluate(variableName, variables, def, parameters, setter); } } return(Empty <IOperationProvider> .List.Value); }
public static IComponentManager UseExceptionless(this IComponentManager componentManager, ExceptionlessSetting exceptionlessSetting) { initExceptionless(exceptionlessSetting); componentManager.RegisterAssembly(typeof(ComponentManagerExtend).Assembly); return(componentManager); }
public InjectParameterBinding(IComponentManager manager, HttpParameterDescriptor descriptor) : base(descriptor) { var reflectedDescriptor = descriptor as ReflectedHttpParameterDescriptor; if (reflectedDescriptor != null) { try { var param = reflectedDescriptor.ParameterInfo; var controllerType = param.Member.ReflectedType; var declaringComponent = manager.GetComponent(controllerType); var binders = descriptor.GetCustomAttributes <Attribute>().GetAttributesRecursive <IBinderAttribute>() .Union(new [] { UnwrapAttributeInstance }) .ToArray(); var injectionPoint = new MethodParameterInjectionPoint(declaringComponent, param, binders); var component = injectionPoint.Component; _injectionPoint = injectionPoint; } catch (UnsatisfiedDependencyException) { // Not managed by cormo. Nothing here } } }
/// <summary> /// 初始化 Ls 框架。 /// </summary> public virtual void Initialize() { IocManager.IocContainer.Install(new LsInstaller()); _componentManager = IocManager.Resolve <IComponentManager>(); _componentManager.InitializeComponents(); }
/// <summary> /// 指定したコンポーネント管理クラスのシーンがプリロードしたシーンの使用をやめる /// </summary> /// <param name="releasePreloader"></param> private void UnsetPreloader(IComponentManager releasePreloader) { foreach (KeyValuePair <SceneCondition, HashSet <IComponentManager> > preloader in _preloaders) { preloader.Value.Remove(releasePreloader); } }
internal GraphicEntity(ElementTag tag, IComponentManager manager, IEntityManager emanager, EntityOrderContainer order) { this.order = order; this.manager = manager; this.emanager = emanager; Tag = tag; }
public Task Create(ITemplate templateData, IParameterSet parameters, IComponentManager componentManager, out ICreationResult creationResult) { RunnableProjectTemplate template = (RunnableProjectTemplate)templateData; ProcessMacros(componentManager, template.Config.OperationConfig, parameters); IVariableCollection variables = VariableCollection.SetupVariables(parameters, template.Config.OperationConfig.VariableSetup); template.Config.Evaluate(parameters, variables, template.ConfigFile); IOrchestrator basicOrchestrator = new Core.Util.Orchestrator(); RunnableProjectOrchestrator orchestrator = new RunnableProjectOrchestrator(basicOrchestrator); GlobalRunSpec runSpec = new GlobalRunSpec(template.ConfigFile.Parent, componentManager, parameters, variables, template.Config.OperationConfig, template.Config.SpecialOperationConfig, template.Config.LocalizationOperations, template.Config.PlaceholderFilename); foreach (FileSource source in template.Config.Sources) { runSpec.SetupFileSource(source); string target = Path.Combine(Directory.GetCurrentDirectory(), source.Target); orchestrator.Run(runSpec, template.ConfigFile.Parent.DirectoryInfo(source.Source), target); } // todo: add anything else we'd want to report to the broker creationResult = new CreationResult() { PostActions = PostAction.ListFromModel(template.Config.PostActionModel, variables), PrimaryOutputs = CreationPath.ListFromModel(template.Config.PrimaryOutputs, variables) }; return(Task.FromResult(true)); }
/// <summary> /// 指定したコンポーネント管理クラスのコンポーネントが使用している /// コンテントマネージャーの使用をやめる /// </summary> /// <param name="releaseUser"></param> private void UnsetContentManagerUser(IComponentManager releaseUser) { foreach (KeyValuePair <string, HashSet <IComponentManager> > user in _contentManagerUsers) { user.Value.Remove(releaseUser); } }
internal virtual IComponentManager CreateIComponentManager() { // TODO: 实例化相应的具体类。 IComponentManager target = null; return(target); }
public IEnumerable <IOperationProvider> Process(IComponentManager componentManager, JObject rawConfiguration, IDirectory templateRoot, IVariableCollection variables, IParameterSet parameters) { string startToken = rawConfiguration.ToString("start"); string endToken = rawConfiguration.ToString("end"); string id = rawConfiguration.ToString("id"); yield return(new Include(startToken, endToken, x => templateRoot.FileInfo(x).OpenRead(), id)); }
internal void Register(IComponentManager componentManager) { if (componentManager.Initialized) { return; } components.Add(componentManager); }
public void PostComponentMessageTest() { IComponentManager target = CreateIComponentManager(); // TODO: 初始化为适当的值 ComponentMessage componentMessage = new ComponentMessage(); // TODO: 初始化为适当的值 target.PostComponentMessage(componentMessage); Assert.Inconclusive("无法验证不返回值的方法。"); }
/// <summary> /// Constructor for SystemManager /// </summary> public SystemManager(IComponentManager pComponentManager) { // INSTANTIATE _systems _systems = new List <ISystem>(); // INSTANTIATE _componentManager _componentManager = pComponentManager; }
public TransformToolViewModel(IComponentManager componentManager) { ApplyCommand = new RelayCommand(ApplyTransform); _selectionManager = componentManager.GetComponent <SelectionManager>(); _commandExecutor = componentManager.GetComponent <CommandExecutor>(); _selectionManager.SelectionChanged += SelectionChanged; }
public void Initialize (ScriptEngine module) { m_module = module; m_manager = module.Worlds[0].RequestModuleInterface<IComponentManager> (); DefaultComponents com = new DefaultComponents (m_componentName); m_manager.RegisterComponent (com); }
private void EnsureLoaded() { if (_isLoaded) { return; } string userSettings = null; using (Timing.Over("Read settings")) for (int i = 0; i < MaxLoadAttempts; ++i) { try { userSettings = _paths.ReadAllText(_paths.User.SettingsFile, "{}"); break; } catch (IOException) { if (i == MaxLoadAttempts - 1) { throw; } Task.Delay(2).Wait(); } } JObject parsed; using (Timing.Over("Parse settings")) parsed = JObject.Parse(userSettings); using (Timing.Over("Deserialize user settings")) _userSettings = new SettingsStore(parsed); using (Timing.Over("Init probing paths")) if (_userSettings.ProbingPaths.Count == 0) { _userSettings.ProbingPaths.Add(_paths.User.Content); } using (Timing.Over("Init Component manager")) _componentManager = new ComponentManager(this, _userSettings); using (Timing.Over("Init Mount Point manager")) _mountPointManager = new MountPointManager(_environmentSettings, _componentManager); using (Timing.Over("Demand template load")) EnsureTemplatesLoaded(); _mountPoints = new Dictionary <Guid, MountPointInfo>(); using (Timing.Over("Load mount points")) foreach (MountPointInfo info in _userSettings.MountPoints) { _mountPoints[info.MountPointId] = info; } _isLoaded = true; }
/// <summary> /// シーンをプリロードしたシーンのコンポーネント管理クラスを登録する /// </summary> /// <param name="preloadSceneCondition"></param> /// <param name="preloader"></param> private void SetPreloader(SceneCondition preloadSceneCondition, IComponentManager preloader) { if (!_preloaders.ContainsKey(preloadSceneCondition)) { _preloaders[preloadSceneCondition] = new HashSet <IComponentManager>(); } _preloaders[preloadSceneCondition].Add(preloader); }
public FriendshipPunter(IScorer scorer) { this.scorer = scorer; graphVisitor = new GraphVisitor(); componentManager = new ComponentManager(scorer); state = new PunterState { }; }
public void Initialize(ScriptEngine module) { m_module = module; m_manager = module.Worlds[0].RequestModuleInterface <IComponentManager> (); DefaultComponents com = new DefaultComponents(m_componentName); m_manager.RegisterComponent(com); }
/// <summary> /// あるコンテントマネージャーを使用するコンポーネントが所属するコンポーネントマネージャーを登録する /// </summary> /// <param name="contentManager"></param> /// <param name="user"></param> private void SetContentManagerUser(string contentManager, IComponentManager user) { if (!_contentManagerUsers.ContainsKey(contentManager)) { _contentManagerUsers[contentManager] = new HashSet <IComponentManager>(); } _contentManagerUsers[contentManager].Add(user); }
public bool RemoveComponent(IComponentManager c) { if (!HasComponent(c)) { return(false); } Components.Remove(c); return(true); }
public bool AddComponent(IComponentManager c) { if (this.HasComponent(c)) { return(false); } Components.Add(c); return(true); }
public void SubScribeComponentMessageTest() { IComponentManager target = CreateIComponentManager(); // TODO: 初始化为适当的值 ComponentId componentId = new ComponentId(); // TODO: 初始化为适当的值 ComponentMessage componentMessage = new ComponentMessage(); // TODO: 初始化为适当的值 target.SubScribeComponentMessage(componentId, componentMessage); Assert.Inconclusive("无法验证不返回值的方法。"); }
public DefaultService() { manager = new ComponentsManager(); }
public ControlWrapper() { _componentManager = ServiceLocator.Current.GetInstance<ComponentManager>(); }
public ComponentService() { manager = new ComponentsManager(); }
/// <summary> /// 指定したコンポーネント管理クラスのコンポーネントが使用している /// コンテントマネージャーの使用をやめる /// </summary> /// <param name="releaseUser"></param> private void UnsetContentManagerUser(IComponentManager releaseUser) { foreach (KeyValuePair<string, HashSet<IComponentManager>> user in _contentManagerUsers) { user.Value.Remove(releaseUser); } }
/// <summary> /// あるコンテントマネージャーを使用するコンポーネントが所属するコンポーネントマネージャーを登録する /// </summary> /// <param name="contentManager"></param> /// <param name="user"></param> private void SetContentManagerUser(string contentManager, IComponentManager user) { if (!_contentManagerUsers.ContainsKey(contentManager)) { _contentManagerUsers[contentManager] = new HashSet<IComponentManager>(); } _contentManagerUsers[contentManager].Add(user); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here componentManager = BasicComponentManager.Instance; worldManager = WorldManager.Instance; collisionManager = CollisionManager.Instance; entityManager = EntityManager.Instance; // batch manager SpriteBatchManager.Instance.initialize(GraphicsDevice); if (isDebugMode) { gameDebug = GameDebug.Instance; gameConsole = XNAConsole.Instance; } base.Initialize(); }
/// <summary> /// 指定したコンポーネント管理クラスのシーンがプリロードしたシーンの使用をやめる /// </summary> /// <param name="releasePreloader"></param> private void UnsetPreloader(IComponentManager releasePreloader) { foreach (KeyValuePair<SceneCondition, HashSet<IComponentManager>> preloader in _preloaders) { preloader.Value.Remove(releasePreloader); } }
/// <summary> /// シーン情報を作成する /// </summary> /// <param name="sceneCondition"></param> /// <param name="componentManager"></param> public SceneData(SceneCondition sceneCondition, IComponentManager componentManager) { SceneCondition = sceneCondition; ComponentManager = componentManager; }
/// <summary> /// 所属するコンポーネントの描画順位に加算する /// </summary> public void AddDrawOrder(IComponentManager beforeScene) { int baseDrawOrder; if (beforeScene == null) { baseDrawOrder = 0; } else { baseDrawOrder = beforeScene.MaxDrawOrder + 1; } AddDrawOrder(baseDrawOrder); }
/// <summary> /// 所属するコンポーネントの更新順位を追加した順にインクリメントで設定する /// </summary> /// <param name="beforeScene"></param> public void IncUpdateOrder(IComponentManager beforeScene) { int baseUpdateOrder; if (beforeScene == null) { baseUpdateOrder = 0; } else { baseUpdateOrder = beforeScene.MaxUpdateOrder + 1; } IncUpdateOrder(baseUpdateOrder); }
public void Initialize(ScriptEngine module) { m_module = module; m_manager = module.Worlds[0].RequestModuleInterface<IComponentManager>(); }
/// <summary> /// シーンをプリロードしたシーンのコンポーネント管理クラスを登録する /// </summary> /// <param name="preloadSceneCondition"></param> /// <param name="preloader"></param> private void SetPreloader(SceneCondition preloadSceneCondition, IComponentManager preloader) { if (!_preloaders.ContainsKey(preloadSceneCondition)) { _preloaders[preloadSceneCondition] = new HashSet<IComponentManager>(); } _preloaders[preloadSceneCondition].Add(preloader); }