コード例 #1
0
        internal static void ReadTiles(BinaryReader reader)
        {
            Tables tables = Tables.Create();
            ushort count  = reader.ReadUInt16();

            for (int k = 0; k < count; k++)
            {
                ushort type    = reader.ReadUInt16();
                string modName = reader.ReadString();
                string name    = reader.ReadString();
                Mod    mod     = ModLoader.GetMod(modName);
                tables.tiles[type]          = mod == null ? (ushort)0 : (ushort)mod.TileType(name);
                tables.frameImportant[type] = reader.ReadBoolean();
            }
            count = reader.ReadUInt16();
            for (int k = 0; k < count; k++)
            {
                ushort wall    = reader.ReadUInt16();
                string modName = reader.ReadString();
                string name    = reader.ReadString();
                Mod    mod     = ModLoader.GetMod(modName);
                tables.walls[wall] = mod == null ? (ushort)0 : (ushort)mod.WallType(name);
            }
            ReadTileData(reader, tables);
        }
コード例 #2
0
 /// <summary>
 /// Gets the DataTables.
 /// </summary>
 /// <param name="helper">The HTML helper instance that this method extends.</param>
 /// <param name="id">Id table.</param>
 /// <param name="options">Options for create table.</param>
 /// <param name="htmlAttributes">An object that contains the HTML attributes to set for the element.</param>
 /// <returns></returns>
 public static MvcHtmlString DataTables(this HtmlHelper helper, string id, DataTablesOptions options, object htmlAttributes)
 {
     if (string.IsNullOrEmpty(id))
     {
         throw new ArgumentException("Empty: Id");
     }
     return(Tables.Create(id, options, htmlAttributes));
 }
コード例 #3
0
 /// <summary>
 /// Gets the DataTables.
 /// </summary>
 /// <typeparam name="TModel">The type of the model.</typeparam>
 /// <param name="helper">The HTML helper instance that this method extends.</param>
 /// <param name="id">Id table.</param>
 /// <param name="options">Options for create table.</param>
 /// <returns></returns>
 public static MvcHtmlString DataTables <TModel>(this HtmlHelper helper, string id, DataTablesOptions <TModel> options)
 {
     if (string.IsNullOrEmpty(id))
     {
         throw new ArgumentException("Empty: Id");
     }
     return(Tables.Create(id, options));
 }
コード例 #4
0
 public PhoneOrderRepository()
 {
     if (null == phoneOrders)
     {
         var phoneOrderTable = Tables.Create <PhoneOrderEntity, Guid>(u => u.Id, null);
         phoneOrders = phoneOrderTable;
     }
 }
コード例 #5
0
        public RuleDatabase()
        {
            var choiceTable = Tables.Create(p => p.Pk, new IdentitySpecification <ChoiceEntity>(x => x.Pk, 1, 1));
            var stepTable   = Tables.Create(p => p.Pk, new IdentitySpecification <StepEntity>(x => x.Pk, 1, 1));
            var choiceIndex = choiceTable.CreateIndex(new RedBlackTreeIndexFactory(), p => p.PkStep);

            Tables.CreateRelation(stepTable.PrimaryKeyIndex, choiceIndex, x => x, x => x);
            Choices = choiceTable;
            Steps   = stepTable;
        }
コード例 #6
0
        public OrdersDatabase()
        {
            var orders = Tables.Create(x => x.Id, new IdentitySpecification <Order>(s => s.Id, 1, 1));

            // Constrains referring not nullable fields.
            // There are no length restricions because they are validated during parsing process
            orders.Contraints.Add(new NotNullableConstraint <Order, string>(x => x.ClientId));
            orders.Contraints.Add(new NotNullableConstraint <Order, long>(x => x.RequestId));
            orders.Contraints.Add(new NotNullableConstraint <Order, string>(x => x.Name));
            orders.Contraints.Add(new NotNullableConstraint <Order, decimal>(x => x.Price));

            Orders = orders;
        }
コード例 #7
0
        public BackendDb(bool doNotSeed)
        {
            var userTable  = Tables.Create <User, int>(u => u.Id, new IdentitySpecification <User>(u => u.Id));
            var classTable = Tables.Create <Class, int>(c => c.Id, new IdentitySpecification <Class>(u => u.Id));

            var userClassIdIndex = userTable.CreateIndex(
                new RedBlackTreeIndexFactory(),
                p => p.Id);

            Tables.CreateRelation <User, int, Class, int>(
                userTable.PrimaryKeyIndex,
                classTable.CreateIndex(new RedBlackTreeIndexFactory(), x => x.StudentId),
                x => x, x => x, new RelationOptions());

            Users   = userTable;
            Classes = classTable;

            //Seed database with Users
            //Users
            if (!doNotSeed)
            {
                seed();
            }
        }
コード例 #8
0
 public RateLimitingInMemory()
 {
     FeatureCooldowns = Tables.Create <FeatureCooldown, string>(cooldown => cooldown.Guid);
 }
コード例 #9
0
 public HitActivityInMemory()
 {
     FloodActivities = Tables.Create <HitActivity, string>(entity => entity.Guid);
 }
コード例 #10
0
ファイル: DBModel.cs プロジェクト: snes20/CalculatorAPI
 private DBModel()
 {
     this.Operations = Tables.Create <OperationsModel, int>(x => x.Id, new IdentitySpecification <OperationsModel>(x => x.Id, 1, 1));
 }