示例#1
0
        public async Task <string> CallNone(CObj obj, Stream stream)
        {
            MemoryStream ms = new MemoryStream();
            await stream.CopyToAsync(ms);

            return(stream.Length.ToString());
        }
示例#2
0
    public void InsertObject(IQuadObject in_obj)
    {
        if (_objs_ht.ContainsKey(in_obj.GetId()))
        {
            Debug.LogError(string.Format("Object with ID = {0} already exists", in_obj.GetId()));
            return;
        }

        CQuadLeaf current_quad = _initial_quad;
        int       comparator   = 1;
        RectInt   object_sides = GetObjectSidesOnQuadMap(in_obj.GetAABB());

        for (int i = _tree_depth; i > 0; i--)
        {
            int k = comparator << i - 1;
            int x = (k & object_sides.xMin) > 0 ? 1 : 0;
            int y = (k & object_sides.yMax) > 0 ? 1 : 0;
            if (x > 0 != (k & object_sides.xMax) > 0 || y > 0 != (k & object_sides.yMin) > 0)
            {
                break;
            }
            int index = (y << 1) + x;
            current_quad = current_quad.GetQuadOrCreateNewIfNonExist(index);
        }

        CObj obj = new CObj(in_obj, new AABB2D(object_sides.xMin, object_sides.yMax, object_sides.xMax, object_sides.yMin), current_quad);

        current_quad.AddObject(obj);
        _objs_ht.Add(in_obj.GetId(), obj);
    }
示例#3
0
        public async Task <CObj> CallNone(CObj obj, Func <double, Task> cb, Stream stream)
        {
            var ss = stream as ProxyStream;
            //ss.ProgressAsync += async (s, e) =>
            //{
            //    Console.WriteLine(e.Value);
            //    await cb(e.Value);
            //};
            var ms = new MemoryStream();
            await stream.CopyToAsync(ms);

            return(new CObj());
        }
示例#4
0
    void tileCalculate(CObj.TiledType type)
    {
        switch (type)
        {
            case CObj.TiledType.horizon:

                break;

            case CObj.TiledType.vertical:

                break;

            case CObj.TiledType.tiled:

                break;
        }
    }
示例#5
0
 public Task <CustomObj> Call2Async(CObj obj, string s1, string s2)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public Task <string> CallNone2(CObj obj)
 {
     throw new NotImplementedException();
 }
示例#7
0
 public void AddObject(CObj in_obj)
 {
     _objects.Add(in_obj);
 }