コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public async static Task <Weapon> Add(Weapon w, StatContext context)
        {
            await context.AddAsync(w);

            await context.SaveChangesAsync();

            return(w);
        }
コード例 #4
0
        public async static Task <List <Weapon> > GetAllWeapons(StatContext context)
        {
            List <Weapon> weapons = await context.Weapons
                                    .OrderBy(w => w.WeaponId)
                                    .ToListAsync();

            return(weapons);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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();
            }
        }
コード例 #8
0
        public float?GetInitialStat(float count, StatContext context)
        {
            try
            {
                return(Formula(count, context));
            }
            catch (NullReferenceException e)
            {
                ItemStatsMod.Logger.LogError("Caught " + e);
            }

            return(null);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
ファイル: EMacroParser.cs プロジェクト: jingjiajie/WMSClient
    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);
    }
コード例 #11
0
        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);
        }
コード例 #12
0
ファイル: CalcParser.cs プロジェクト: PretDB/FA_Language
        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);
        }
コード例 #13
0
ファイル: AzSQLParser.cs プロジェクト: getsqldata/AzSQL
    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);
    }
コード例 #14
0
 public StatContextSeedData(StatContext context, UserManager<Player> userManager)
 {
     _context = context;
     _userManager = userManager;
 }
コード例 #15
0
 public string Format(float result, ItemIndex itemIndex, int statIndex, StatContext context)
 {
     return(FormatFunc(result, itemIndex, statIndex, context));
 }
コード例 #16
0
 public int ModifyItemCount(int count, ItemIndex itemIndex, int statIndex, StatContext context)
 {
     return(ModifyItemCountFunc(count, itemIndex, statIndex, context));
 }
コード例 #17
0
 public float ModifyValue(float result, ItemIndex itemIndex, int statIndex, StatContext context)
 {
     return(ModifyValueFunc(result, itemIndex, statIndex, context));
 }
コード例 #18
0
ファイル: StatRepository.cs プロジェクト: cbusjay/TheTeam
 public StatRepository(StatContext context, ILogger<StatRepository> logger)
 {
     _context = context;
     _logger = logger;
 }
コード例 #19
0
 public AssignContext(StatContext context)
 {
     CopyFrom(context);
 }
コード例 #20
0
 public HomeController(StatContext context)
 {
     _context = context;
 }
コード例 #21
0
 public ArticlesController(StatContext context)
 {
     _context = context;
 }
コード例 #22
0
        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);
            }
        }
コード例 #23
0
 public ArticlesViewComponent(StatContext context)
 {
     _context = context;
 }
コード例 #24
0
 public ApiGetLigaController(StatContext context)
 {
     _context = context;
 }
コード例 #25
0
 public PrintExprContext(StatContext context)
 {
     CopyFrom(context);
 }
コード例 #26
0
 public BlankContext(StatContext context)
 {
     CopyFrom(context);
 }
コード例 #27
0
 public ApiGetGameController(StatContext context)
 {
     _context = context;
 }
コード例 #28
0
        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));
            }
        }
コード例 #29
0
 public Team2Controller(StatContext context)
 {
     _context = context;
 }
コード例 #30
0
 public GamesController(StatContext context)
 {
     _context = context;
 }
コード例 #31
0
 public StatisticsController(StatContext context)
 {
     _context = context;
 }
コード例 #32
0
 public virtual void CopyFrom(StatContext context)
 {
     base.CopyFrom(context);
 }
コード例 #33
0
 public StatViewComponent(StatContext context)
 {
     _context = context;
 }
コード例 #34
0
 public LigaController(StatContext context)
 {
     _context = context;
 }