Exemple #1
0
        public async Task <IActionResult> PutXLevel([FromRoute] Guid id, [FromBody] XLevel varXLevel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != varXLevel.XLevelId)
            {
                return(BadRequest());
            }

            _context.Entry(varXLevel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!XLevelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #2
0
        public void Init()
        {
            Compiler.Instance.VariableStorage.Clear();

            level = new XLevel()
            {
                Id = "lvlTest", Subcomponents = new XObjectCollection()
            };
            system = new XSystem {
                Id = "system"
            };
            block = new XBlock()
            {
                Id = "blkBlock01", Bounds = new RectangleF(10, 10, 20, 20)
            };
            numAnimation = new XNumAnimation()
            {
                Id = "anmNum01", Subcomponents = new XObjectCollection()
            };
            boolTrigger = new XBoolTrigger();

            numAnimation.Subcomponents.Add(boolTrigger);

            level.Subcomponents.Add(system);
            level.Subcomponents.Add(block);
            level.Subcomponents.Add(numAnimation);
        }
Exemple #3
0
        public async Task <IActionResult> PostXLevel([FromBody] XLevel varXLevel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.XLevel.Add(varXLevel);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetXLevel", new { id = varXLevel.XLevelId }, varXLevel));
        }
Exemple #4
0
        public void Init()
        {
            Compiler.Instance.VariableStorage.Clear();

            level = new XLevel() { Id = "lvlTest", Subcomponents = new XObjectCollection() };
            system = new XSystem { Id="system" };
            block = new XBlock() { Id = "blkBlock01", Bounds = new RectangleF(10, 10, 20, 20) };
            numAnimation = new XNumAnimation() { Id = "anmNum01", Subcomponents = new XObjectCollection() };
            boolTrigger = new XBoolTrigger();

            numAnimation.Subcomponents.Add(boolTrigger);

            level.Subcomponents.Add(system);
            level.Subcomponents.Add(block);
            level.Subcomponents.Add(numAnimation);
        }