public async Task <IActionResult> Edit(int id, [Bind("note_id,category,main_name,long_description,tags")] NoteSet adres)
        {
            if (id != adres.note_id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(adres);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KlientExists(adres.note_id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(adres));
        }
Example #2
0
    void SendNote()
    {
        NoteSet noteSet = new NoteSet();

        float doubleNoteRng = Random.Range(0f, 1f);

        if (doubleNoteRng < DoubleNoteChance)
        {
            NoteMultiplier++;
        }

        int tempIndex = 0;

        for (int i = 0; i < NoteMultiplier; i++)
        {
            //While-loop are to ensure unique notes every send.
            do
            {
                tempIndex = Random.Range(0, NumberOfUniqueNotes);
            }while (noteIndex == tempIndex && doubleNoteRng < DoubleNoteChance);
            noteIndex = tempIndex;


            noteSet.Notes.Add(Instantiate(NotePrefabs[noteIndex], new Vector2(transform.position.x + NoteSpawnXOffset[noteIndex], transform.position.y), Quaternion.identity));
            NotesTotal++;
        }
        NoteSets.Add(noteSet);

        if (NoteMultiplier > 1)
        {
            NoteMultiplier = 1;
        }

        noteSpawnTimer = 0;
    }
        public async Task <IActionResult> Create([Bind("note_id,category,main_name,long_description,tags")] NoteSet adres)
        {
            if (ModelState.IsValid)
            {
                _context.Add(adres);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(adres));
        }
Example #4
0
 public Scale(Note root, NoteSet notes)
 {
 }