Example #1
0
        public async Task Clear()
        {
            var request = new RestRequest("/scene/services/worldgeometryservice/topology", Method.DELETE);
            var response = await _connection.Request(request);

            if (response.ResponseStatus == ResponseStatus.Completed)
                Root = null;
        }
Example #2
0
        public async Task<ProceduralNode> Refresh()
        {
            var request = new RestRequest("/scene/services/worldgeometryservice/topology", Method.GET);
            var response = await _connection.Request<ProceduralNode>(request);

            if (response.ResponseStatus == ResponseStatus.Completed)
                Root = response.Data;
            return Root;
        }
Example #3
0
        public async Task<bool> SetRoot(Guid scriptId, RemoteRootInit data, int seed)
        {
            var request = new RestRequest("/scene/services/worldgeometryservice/topology", Method.PUT);

            var body = scriptId + Environment.NewLine +
                       seed + Environment.NewLine +
                       JsonConvert.SerializeObject(data);
            request.AddParameter("text", body, ParameterType.RequestBody);

            var response = await _connection.Request(request);

            if (response.ResponseStatus == ResponseStatus.Completed)
            {
                Root = null;
                await Refresh();
                return true;
            }

            return false;
        }
 public ProceduralNodeViewModel(ProceduralNode node)
 {
     _node = node;
     _children = node.Children.Select(a => new ProceduralNodeViewModel(a)).ToList();
 }