internal void ReadFromComponentSchema(ComponentSchema schema) { ThrowIfInitialized(); _initialized = true; InitializeComponent(); ReadComponentSchema(schema); }
protected override void ReadComponentSchema(ComponentSchema schema) { Strength = schema.GetValue("strength", 10); Dexterity = schema.GetValue("dexterity", 10); Constitution = schema.GetValue("constitution", 10); Intelligence = schema.GetValue("intelligence", 10); Wisdom = schema.GetValue("wisdom", 10); Charisma = schema.GetValue("charisma", 10); Class = schema.GetValue <ObjectSchema>("class").Instantiate <CharacterClass>(); }
public override async Task <SigmaGraphModel> Execute(UriQuery query) { // find query text var uri = _perspectiveNamingConvention.Decompose(query.Uri); var schema = await _queryService.Execute(new PerspectiveSchemaQuery() { PerspectiveId = uri.PerspectiveId, Substitutions = query.Parameters, UserName = Auth.UserName }, this); if (uri.Page == null || uri.ComponentId == null) { return(null); } var statements = uri.Section.HasValue ? schema.Pages[uri.Page.Value].Sections[uri.Section.Value].Statements : schema.Pages[uri.Page.Value].Statements; ComponentSchema graphComponent = null; foreach (var statement in statements) { if ( statement.Component?.Statements? .FirstOrDefault( s => s.Assignement?.Name == "Uri" && ((string)s.Assignement?.Value) == uri.ComponentId) != null) { graphComponent = statement.Component; } } if (graphComponent == null) { return(null); } var graphQuery = new StringBuilder(); foreach (var statement in graphComponent.Statements) { if (statement.Assignement != null && QUERY_CLAUSES.Contains(statement.Assignement.Name)) { graphQuery.Append(statement.Assignement.Name.ToUpper()); graphQuery.Append(" "); graphQuery.Append(statement.Assignement.Value); graphQuery.Append("\n"); } } _log.Debug(graphQuery); // query graph var graphModel = await _queryService.Execute(new SigmaQuery() { NetworkId = query.NetworkId, DoLayout = true, QueryText = graphQuery.ToString(), Cache = query.Cache }, this); return(graphModel); }
protected virtual void ReadComponentSchema(ComponentSchema schema) { }
protected override void ReadComponentSchema(ComponentSchema schema) { RaceName = schema.GetValue("race_name", "none"); }
public void ReadComponentSchema(ComponentSchema schema) { }