/// <summary> /// Returns a single weapon or null if no match /// </summary> /// <param name="id"></param> /// <param name="context"></param> public async static Task <Weapon> GetWeaponById(int id, StatContext context) { Weapon w = await(from weapon in context.Weapons where weapon.WeaponId == id select weapon).SingleOrDefaultAsync(); return(w); }
public async static Task <Weapon> GetWeaponByName(string name, StatContext context) { Weapon w = await(from weapon in context.Weapons where weapon.WeaponName == name select weapon).SingleOrDefaultAsync(); return(w); }
public async static Task <Weapon> Add(Weapon w, StatContext context) { await context.AddAsync(w); await context.SaveChangesAsync(); return(w); }
public async static Task <List <Weapon> > GetAllWeapons(StatContext context) { List <Weapon> weapons = await context.Weapons .OrderBy(w => w.WeaponId) .ToListAsync(); return(weapons); }
public async static Task <Stat> GetStatById(int id, StatContext context) { Stat s = await(from stat in context.Stats where stat.StatId == id select stat).SingleOrDefaultAsync(); return(s); }
public async static Task <Weapon> Edit(Weapon w, StatContext context) { await context.AddAsync(w); context.Entry(w).State = EntityState.Modified; await context.SaveChangesAsync(); return(w); }
public async static Task Delete(int id, StatContext context) { Weapon w = await GetWeaponById(id, context); if (w != null) { await context.AddAsync(w); context.Entry(w).State = EntityState.Deleted; await context.SaveChangesAsync(); } }
public float?GetInitialStat(float count, StatContext context) { try { return(Formula(count, context)); } catch (NullReferenceException e) { ItemStatsMod.Logger.LogError("Caught " + e); } return(null); }
public StatContext stat() { StatContext _localctx = new StatContext(_ctx, State); EnterRule(_localctx, 2, RULE_stat); try { State = 20; switch (Interpreter.AdaptivePredict(_input, 1, _ctx)) { case 1: _localctx = new PrintExprContext(_localctx); EnterOuterAlt(_localctx, 1); { State = 11; expr(0); State = 12; Match(NEWLINE); } break; case 2: _localctx = new AssignContext(_localctx); EnterOuterAlt(_localctx, 2); { State = 14; Match(ID); State = 15; Match(3); State = 16; expr(0); State = 17; Match(NEWLINE); } break; case 3: _localctx = new BlankContext(_localctx); EnterOuterAlt(_localctx, 3); { State = 19; Match(NEWLINE); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public StatContext stat() { StatContext _localctx = new StatContext(Context, State); EnterRule(_localctx, 0, RULE_stat); int _la; try { EnterOuterAlt(_localctx, 1); { State = 21; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la == TEXT) { { State = 20; text(); } } State = 26; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << TEXT_SHARP) | (1L << TEXT_AT) | (1L << COMMAND_SHARP) | (1L << JS_SHARP) | (1L << JS_AT))) != 0)) { { { State = 23; command(); } } State = 28; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public StatContext stat() { StatContext _localctx = new StatContext(_ctx, State); EnterRule(_localctx, 0, RULE_stat); try { State = 15; _errHandler.Sync(this); switch (_input.La(1)) { case PARENI: case INT: EnterOuterAlt(_localctx, 1); { State = 10; _localctx.c = exp(); State = 11; Match(NEWLINE); System.Console.Write(_localctx.c.value); } break; case NEWLINE: EnterOuterAlt(_localctx, 2); { State = 14; Match(NEWLINE); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public StatContext stat() { StatContext _localctx = new StatContext(_ctx, State); EnterRule(_localctx, 2, RULE_stat); try { EnterOuterAlt(_localctx, 1); { State = 12; expr(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public StatContext stat() { StatContext _localctx = new StatContext(Context, State); EnterRule(_localctx, 0, RULE_stat); try { EnterOuterAlt(_localctx, 1); { State = 16; select_clause(); } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public StatContextSeedData(StatContext context, UserManager<Player> userManager) { _context = context; _userManager = userManager; }
public string Format(float result, ItemIndex itemIndex, int statIndex, StatContext context) { return(FormatFunc(result, itemIndex, statIndex, context)); }
public int ModifyItemCount(int count, ItemIndex itemIndex, int statIndex, StatContext context) { return(ModifyItemCountFunc(count, itemIndex, statIndex, context)); }
public float ModifyValue(float result, ItemIndex itemIndex, int statIndex, StatContext context) { return(ModifyValueFunc(result, itemIndex, statIndex, context)); }
public StatRepository(StatContext context, ILogger<StatRepository> logger) { _context = context; _logger = logger; }
public AssignContext(StatContext context) { CopyFrom(context); }
public HomeController(StatContext context) { _context = context; }
public ArticlesController(StatContext context) { _context = context; }
private void _WriteStatValue(BitBuffer bitBuffer, int value, Object valueRow, ExcelFile valueTable, int bitCount, StatContext statContext) { if (bitCount <= 0) return; if (valueTable == null) { bitBuffer.WriteBits(value, bitCount); return; } if (valueRow == null) { bitBuffer.WriteBits(0, bitCount); return; } if (statContext == StatContext.UseRows) { int rowIndex = valueTable.Rows.IndexOf(valueRow); bitBuffer.WriteBits(rowIndex, bitCount); } else { int code = _fileManager.GetCodeFromRow(valueTable.TableCode, valueRow); bitBuffer.WriteBits(code, bitCount); } }
public ArticlesViewComponent(StatContext context) { _context = context; }
public ApiGetLigaController(StatContext context) { _context = context; }
public PrintExprContext(StatContext context) { CopyFrom(context); }
public BlankContext(StatContext context) { CopyFrom(context); }
public ApiGetGameController(StatContext context) { _context = context; }
private void _ReadStatValue(BitBuffer bitBuffer, int bitCount, ref int value, ExcelFile valueTable, ref Object valueRow, StatContext statContext) { if (bitCount <= 0) return; value = bitBuffer.ReadBits(bitCount); if (valueTable == null) return; if (statContext == StatContext.UseRows) { if (value >= 0 && value < valueTable.Rows.Count) { valueRow = valueTable.Rows[value]; } if (valueRow == null) Debug.WriteLine(String.Format("Warning: OutOfBounds stat index {0} on table {1}", value, valueTable.TableCode)); } else { valueRow = _fileManager.GetRowFromCode(valueTable.TableCode, (short)value); if (valueRow == null) Debug.WriteLine(String.Format("Warning: Unknown stat value code {0} (0x{0:X4}) on table {1}", value, valueTable.TableCode)); } }
public Team2Controller(StatContext context) { _context = context; }
public GamesController(StatContext context) { _context = context; }
public StatisticsController(StatContext context) { _context = context; }
public virtual void CopyFrom(StatContext context) { base.CopyFrom(context); }
public StatViewComponent(StatContext context) { _context = context; }
public LigaController(StatContext context) { _context = context; }