Esempio n. 1
0
    IEnumerator MoveSwapPuzzle(Vector3 traget, puzzle p)
    {
        float accuracy = 0.00001f;

        while (Vector3.Distance(p.transform.position, traget) > accuracy)
        {
            p.transform.position = Vector3.MoveTowards(p.transform.position, traget, 6.0f + Time.deltaTime);
            yield return(0);
        }
    }
Esempio n. 2
0
 public PuzzleView(puzzle p)
 {
     pid         = p.pid;
     pgid        = p.pgid;
     type        = p.type;
     title       = p.title;
     content     = p.content;
     image       = p.image;
     html        = p.html;
     answer_type = p.answer_type;
 }
        public async Task EditPuzzle(Request request, Response response)
        {
            var userSession = await CheckAuth.Check(request, response, AuthLevel.Organizer);

            if (userSession == null)
            {
                return;
            }

            var requestJson = request.Json <EditPuzzleRequest>();

            //判断请求是否有效
            if (!Validation.Valid(requestJson, out string reason))
            {
                await response.BadRequest(reason);

                return;
            }

            //生成修改后对象
            var updatePuzzle = new puzzle
            {
                pid            = requestJson.pid,
                pgid           = requestJson.pgid,
                type           = requestJson.type,
                title          = requestJson.title,
                content        = requestJson.content,
                image          = requestJson.image,
                html           = requestJson.html,
                answer_type    = requestJson.answer_type,
                answer         = requestJson.answer,
                jump_keyword   = requestJson.jump_keyword,
                extend_content = requestJson.extend_content
            };

            var puzzleDb = DbFactory.Get <Puzzle>();
            await puzzleDb.SimpleDb.AsUpdateable(updatePuzzle).ExecuteCommandAsync();

            await puzzleDb.InvalidateCache();

            await response.OK();
        }
 private void Awake()
 {
     _puzzle = gameObject.GetComponent <puzzle>();
 }
Esempio n. 5
0
 public PuzzleOverview(puzzle p)
 {
     pid         = p.pid;
     title       = p.title;
     answer_type = p.answer_type;
 }
Esempio n. 6
0
 Puzzle   = StringTo2DChar(puzzle, Rows, Cols);