示例#1
0
        public SlotModels(string baseNamespace, GrammarInfo grammarInfo)
        {
            Namespace = baseNamespace;

            // Wenn eine Regel aus mehr als einer Alternative besteht, dann wird diese zur Basisklasse
            // für die konkreten Syntaxen
            var baseRules = new Dictionary <string, string>();

            foreach (var parserRule in grammarInfo.Rules.Where(rule => rule.Alternatives.Count > 1))
            {
                AbstractSlots.Add(new AbstractSlotModel(rule: parserRule, baseNamespace: baseNamespace));

                foreach (var alternative in parserRule.Alternatives)
                {
                    baseRules[alternative.Elements[0].Name] = parserRule.Name;
                }
            }

            // Aus Regeln mir genau einer "Alternative" werden zu konkreten Syntaxen
            foreach (var parserRule in grammarInfo.Rules.Where(rule => rule.Alternatives.Count == 1))
            {
                baseRules.TryGetValue(parserRule.Name, out var baseRule);

                Slots.Add(new SlotModel(rule: parserRule, baseRule: baseRule, baseNamespace: baseNamespace, grammarInfo));
            }
        }
示例#2
0
        public BocsNodeTangent()
        {
            //NodeType* type = NodeType::add("tangent", create, NodeType::SHADER);

            //static NodeEnum direction_type_enum;
            //direction_type_enum.insert("radial", NODE_TANGENT_RADIAL);
            //direction_type_enum.insert("uv_map", NODE_TANGENT_UVMAP);
            //SOCKET_ENUM(direction_type, "Direction Type", direction_type_enum, NODE_TANGENT_RADIAL);

            //static NodeEnum axis_enum;
            //axis_enum.insert("x", NODE_TANGENT_AXIS_X);
            //axis_enum.insert("y", NODE_TANGENT_AXIS_Y);
            //axis_enum.insert("z", NODE_TANGENT_AXIS_Z);
            //SOCKET_ENUM(axis, "Axis", axis_enum, NODE_TANGENT_AXIS_X);

            //SOCKET_STRING(attribute, "Attribute", ustring(""));

            //SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL);
            //SOCKET_OUT_NORMAL(tangent, "Tangent");

            NodeTitle = "Tangent";
            NodeName  = "tangent";

            Slots.Add(new BocsSlotClosure(this, "Tangent", "tangent", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "direction_type", "direction_type", BocsSlotBase.BocsSlotType.Value, 0);

            bsl.List = new string[] { "radial", "uv_map" };
            Slots.Add(bsl);

            BocsSlotStringList bsl2 = new BocsSlotStringList(this, "axis", "axis", BocsSlotBase.BocsSlotType.Value, 0);

            bsl2.List = new string[] { "x", "y", "z" };
            Slots.Add(bsl2);
        }
示例#3
0
 public SpikedClub() : base(ItemIds.SpikedClub, "Spiked club")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(3, TypeName, ModTypes.Flat, StatTypes.Str));
     Slots.Add(EquipSlot.LeftHand);
     Slots.Add(EquipSlot.RightHand);
 }
        public BocsNodeSkyTexture()
        {
            //NodeType* type = NodeType::add("sky_texture", create, NodeType::SHADER);

            //TEXTURE_MAPPING_DEFINE(SkyTextureNode);

            //static NodeEnum type_enum;
            //type_enum.insert("preetham", NODE_SKY_OLD);
            //type_enum.insert("hosek_wilkie", NODE_SKY_NEW);
            //SOCKET_ENUM(type, "Type", type_enum, NODE_SKY_NEW);

            //SOCKET_VECTOR(sun_direction, "Sun Direction", make_float3(0.0f, 0.0f, 1.0f));
            //SOCKET_FLOAT(turbidity, "Turbidity", 2.2f);
            //SOCKET_FLOAT(ground_albedo, "Ground Albedo", 0.3f);

            //SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED);

            //SOCKET_OUT_COLOR(color, "Color");

            NodeTitle = "Sky Texture";
            NodeName  = "sky_texture";

            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotVector3(this, "Direction", "sun_direction", BocsSlotBase.BocsSlotType.Value, new Vector3(0, 0, 1)));
            Slots.Add(new BocsSlotFloat(this, "Turbidity", "turbidity", BocsSlotBase.BocsSlotType.Value, 2.2f));
            Slots.Add(new BocsSlotFloat(this, "Ground Albedo", "ground_albedo", BocsSlotBase.BocsSlotType.Value, .3f));

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));
        }
示例#5
0
        public BocsNodeTextureCoordinate()
        {
            //NodeType* type = NodeType::add("texture_coordinate", create, NodeType::SHADER);

            //SOCKET_BOOLEAN(from_dupli, "From Dupli", false);
            //SOCKET_BOOLEAN(use_transform, "Use Transform", false);
            //SOCKET_TRANSFORM(ob_tfm, "Object Transform", transform_identity());

            //SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL);

            //SOCKET_OUT_POINT(generated, "Generated");
            //SOCKET_OUT_NORMAL(normal, "Normal");
            //SOCKET_OUT_POINT(UV, "UV");
            //SOCKET_OUT_POINT(object, "Object");
            //SOCKET_OUT_POINT(camera, "Camera");
            //SOCKET_OUT_POINT(window, "Window");
            //SOCKET_OUT_NORMAL(reflection, "Reflection");

            NodeTitle = "Texture Coordinate";
            NodeName  = "texture_coordinate";

            Slots.Add(new BocsSlotClosure(this, "Generated", "generated", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "UV", "UV", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Object", "object", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Camera", "camera", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Window", "window", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Reflection", "reflection", BocsSlotBase.BocsSlotType.Output));
        }
示例#6
0
    /// <summary>
    /// Reads the prototype from the specified JObject.
    /// </summary>
    /// <param name="jsonProto">The JProperty containing the prototype.</param>
    public void ReadJsonPrototype(JProperty jsonProto)
    {
        Type = jsonProto.Name;
        JToken innerJson = jsonProto.Value;

        Slot                    = PrototypeReader.ReadJson(Slot, innerJson["Slot"]);
        LocalizationName        = PrototypeReader.ReadJson("gear_" + Type, innerJson["LocalizationName"]);
        LocalizationDescription = PrototypeReader.ReadJson("gear_" + Type + "_desc", innerJson["LocalizationDescription"]);
        if (innerJson["Stats"] != null)
        {
            foreach (JToken stat in innerJson["Stats"])
            {
                Stat prototypeStat = PrototypeManager.Stat.Get(((JProperty)stat).Name);
                Stat newStat       = prototypeStat.Clone();
                int  value         = 0;
                value         = PrototypeReader.ReadJson(value, stat);
                newStat.Value = value;
                Stats.Add(((JProperty)stat).Name, newStat);
            }
        }
        if (innerJson["Slots"] != null)
        {
            string[] slots = new string[0];
            slots = PrototypeReader.ReadJson(slots, innerJson["Slots"]);
            foreach (string slot in slots)
            {
                Slots.Add(slot, false);
            }
        }
    }
        public BocsNodeGeometry()
        {
            //NodeType* type = NodeType::add("geometry", create, NodeType::SHADER);

            //SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL);

            //SOCKET_OUT_POINT(position, "Position");
            //SOCKET_OUT_NORMAL(normal, "Normal");
            //SOCKET_OUT_NORMAL(tangent, "Tangent");
            //SOCKET_OUT_NORMAL(true_normal, "True Normal");
            //SOCKET_OUT_VECTOR(incoming, "Incoming");
            //SOCKET_OUT_POINT(parametric, "Parametric");
            //SOCKET_OUT_FLOAT(backfacing, "Backfacing");
            //SOCKET_OUT_FLOAT(pointiness, "Pointiness");

            NodeTitle = "Geometry";
            NodeName  = "geometry";

            Slots.Add(new BocsSlotClosure(this, "Position", "position", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Tangent", "tangent", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "True Normal", "true_normal", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Incoming", "incoming", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Parametric", "parametric", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Backfacing", "backfacing", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Pointiness", "pointiness", BocsSlotBase.BocsSlotType.Output));
        }
示例#8
0
        public async Task SearchAppointmentsByYearMonthAsync_should_return_aggregate_given_slot_and_appointment()
        {
            await configManager !.SaveConfigAsync(new AppointmentConfig()
            {
                AvailableIntervalStart = new LocalDate(2021, 1, 1),
                AvailableIntervalEnd   = new LocalDate(2021, 12, 31),
            });

            db !.Slots.Add(new AppointmentSlot()
            {
                From        = new LocalDateTime(2021, 5, 1, 10, 0),
                Duration    = Period.FromHours(1),
                CountOfSlot = 1,
            });
            db !.Appointments.Add(new Appointment()
            {
                From     = new LocalDateTime(2021, 5, 1, 10, 0),
                Duration = Period.FromHours(1),
            });
            await db !.SaveChangesAsync();

            var aggregatesForMonth = await sut !.SearchAppointmentsByYearMonthAsync(new YearMonth(2021, 5));

            Assert.IsTrue(aggregatesForMonth.Appointments.First(e => e.Date == new LocalDate(2021, 5, 1)).AllSlots.Any());
            Assert.AreEqual(new LocalDateTime(2021, 5, 1, 10, 0), aggregatesForMonth.Appointments.First(e => e.Date == new LocalDate(2021, 5, 1)).AllSlots.First().From);
            Assert.IsTrue(aggregatesForMonth.Appointments.First(e => e.Date == new LocalDate(2021, 5, 1)).AllSlots.First().Appointments.Any());
        }
示例#9
0
        public BocsNodeLightPath()
        {
            //NodeType* type = NodeType::add("light_path", create, NodeType::SHADER);

            //SOCKET_OUT_FLOAT(is_camera_ray, "Is Camera Ray");
            //SOCKET_OUT_FLOAT(is_shadow_ray, "Is Shadow Ray");
            //SOCKET_OUT_FLOAT(is_diffuse_ray, "Is Diffuse Ray");
            //SOCKET_OUT_FLOAT(is_glossy_ray, "Is Glossy Ray");
            //SOCKET_OUT_FLOAT(is_singular_ray, "Is Singular Ray");
            //SOCKET_OUT_FLOAT(is_reflection_ray, "Is Reflection Ray");
            //SOCKET_OUT_FLOAT(is_transmission_ray, "Is Transmission Ray");
            //SOCKET_OUT_FLOAT(is_volume_scatter_ray, "Is Volume Scatter Ray");
            //SOCKET_OUT_FLOAT(ray_length, "Ray Length");
            //SOCKET_OUT_FLOAT(ray_depth, "Ray Depth");
            //SOCKET_OUT_FLOAT(transparent_depth, "Transparent Depth");
            //SOCKET_OUT_FLOAT(transmission_depth, "Transmission Depth");

            NodeTitle = "Light Path";
            NodeName  = "light_path";

            Slots.Add(new BocsSlotClosure(this, "Is Camera Ray", "is_camera_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Shadow Ray", "is_shadow_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Diffuse Ray", "is_diffuse_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Glossy Ray", "is_glossy_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Singular Ray", "is_singular_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Reflection Ray", "is_reflection_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Transmission Ray", "is_transmission_ray", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Is Volume Scatter Ray", "is_volume_scatter_ray", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotClosure(this, "Ray Length", "ray_length", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Ray Depth", "ray_depth", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotClosure(this, "Transparent Depth", "transparent_depth", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Transmission Depth", "transmission_depth", BocsSlotBase.BocsSlotType.Output));
        }
示例#10
0
        public BocsNodeGradientTexture()
        {
            //NodeType* type = NodeType::add("gradient_texture", create, NodeType::SHADER);

            //TEXTURE_MAPPING_DEFINE(GradientTextureNode);

            //static NodeEnum type_enum;
            //type_enum.insert("linear", NODE_BLEND_LINEAR);
            //type_enum.insert("quadratic", NODE_BLEND_QUADRATIC);
            //type_enum.insert("easing", NODE_BLEND_EASING);
            //type_enum.insert("diagonal", NODE_BLEND_DIAGONAL);
            //type_enum.insert("radial", NODE_BLEND_RADIAL);
            //type_enum.insert("quadratic_sphere", NODE_BLEND_QUADRATIC_SPHERE);
            //type_enum.insert("spherical", NODE_BLEND_SPHERICAL);
            //SOCKET_ENUM(type, "Type", type_enum, NODE_BLEND_LINEAR);

            //SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED);

            //SOCKET_OUT_COLOR(color, "Color");
            //SOCKET_OUT_FLOAT(fac, "Fac");

            NodeTitle = "Gradient Texture";
            NodeName  = "gradient_texture";

            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotFloat(this, "Fac", "fac", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "type", "type", BocsSlotBase.BocsSlotType.Value, 0);

            bsl.List = new string[] { "linear", "quadratic", "easing", "diagonal", "radial", "quadratic_sphere", "spherical" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));
        }
示例#11
0
        public BocsNodeVoronoiTexture()
        {
            //NodeType* type = NodeType::add("voronoi_texture", create, NodeType::SHADER);

            //TEXTURE_MAPPING_DEFINE(VoronoiTextureNode);

            //static NodeEnum coloring_enum;
            //coloring_enum.insert("intensity", NODE_VORONOI_INTENSITY);
            //coloring_enum.insert("cells", NODE_VORONOI_CELLS);
            //SOCKET_ENUM(coloring, "Coloring", coloring_enum, NODE_VORONOI_INTENSITY);

            //SOCKET_IN_FLOAT(scale, "Scale", 1.0f);
            //SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED);

            //SOCKET_OUT_COLOR(color, "Color");
            //SOCKET_OUT_FLOAT(fac, "Fac");

            NodeTitle = "Voronoi Texture";
            NodeName  = "voronoi_texture";

            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Fac", "fac", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "coloring", "coloring", BocsSlotBase.BocsSlotType.Value, 0);

            bsl.List = new string[] { "intensity", "cells" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));
            Slots.Add(new BocsSlotFloat(this, "Scale", "scale", BocsSlotBase.BocsSlotType.Input, 1));
        }
        public BocsNodeParticleInfo()
        {
            //		NodeType* type = NodeType::add("particle_info", create, NodeType::SHADER);

            //		SOCKET_OUT_FLOAT(index, "Index");
            //		SOCKET_OUT_FLOAT(age, "Age");
            //		SOCKET_OUT_FLOAT(lifetime, "Lifetime");
            //		SOCKET_OUT_POINT(location, "Location");
            //#if 0	/* not yet supported */
            //		SOCKET_OUT_QUATERNION(rotation, "Rotation");
            //#endif
            //		SOCKET_OUT_FLOAT(size, "Size");
            //		SOCKET_OUT_VECTOR(velocity, "Velocity");
            //		SOCKET_OUT_VECTOR(angular_velocity, "Angular Velocity");

            NodeTitle = "Particle Info";
            NodeName  = "particle_info";

            Slots.Add(new BocsSlotClosure(this, "Index", "index", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Age", "age", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Lifetime", "lifetime", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Location", "location", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Size", "size", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Velocity", "velocity", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Angular Velocity", "angularvelocity", BocsSlotBase.BocsSlotType.Output));
        }
示例#13
0
        public BocsNodeNormalMap()
        {
            //NodeType* type = NodeType::add("normal_map", create, NodeType::SHADER);

            //static NodeEnum space_enum;
            //space_enum.insert("tangent", NODE_NORMAL_MAP_TANGENT);
            //space_enum.insert("object", NODE_NORMAL_MAP_OBJECT);
            //space_enum.insert("world", NODE_NORMAL_MAP_WORLD);
            //space_enum.insert("blender_object", NODE_NORMAL_MAP_BLENDER_OBJECT);
            //space_enum.insert("blender_world", NODE_NORMAL_MAP_BLENDER_WORLD);
            //SOCKET_ENUM(space, "Space", space_enum, NODE_TANGENT_RADIAL);

            //SOCKET_STRING(attribute, "Attribute", ustring(""));

            //SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL);
            //SOCKET_IN_FLOAT(strength, "Strength", 1.0f);
            //SOCKET_IN_COLOR(color, "Color", make_float3(0.5f, 0.5f, 1.0f));

            //SOCKET_OUT_NORMAL(normal, "Normal");

            NodeTitle = "Normal Map";
            NodeName  = "normal_map";

            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "space", "space", BocsSlotBase.BocsSlotType.Value, 1);

            bsl.List = new string[] { "object", "tangent", "world", "blender_object", "blender_world" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotString(this, "attribute", "attribute", BocsSlotBase.BocsSlotType.Value));

            Slots.Add(new BocsSlotFloat(this, "Strength", "strength", BocsSlotBase.BocsSlotType.Input, 1));
            Slots.Add(new BocsSlotColor(this, "Color", "color", BocsSlotBase.BocsSlotType.Input, Color.gray));
        }
示例#14
0
        public BocsNodeVectorMath()
        {
            //NodeType* type = NodeType::add("vector_math", create, NodeType::SHADER);

            //static NodeEnum type_enum;
            //type_enum.insert("add", NODE_VECTOR_MATH_ADD);
            //type_enum.insert("subtract", NODE_VECTOR_MATH_SUBTRACT);
            //type_enum.insert("average", NODE_VECTOR_MATH_AVERAGE);
            //type_enum.insert("dot_product", NODE_VECTOR_MATH_DOT_PRODUCT);
            //type_enum.insert("cross_product", NODE_VECTOR_MATH_CROSS_PRODUCT);
            //type_enum.insert("normalize", NODE_VECTOR_MATH_NORMALIZE);
            //SOCKET_ENUM(type, "Type", type_enum, NODE_VECTOR_MATH_ADD);

            //SOCKET_IN_VECTOR(vector1, "Vector1", make_float3(0.0f, 0.0f, 0.0f));
            //SOCKET_IN_VECTOR(vector2, "Vector2", make_float3(0.0f, 0.0f, 0.0f));

            //SOCKET_OUT_FLOAT(value, "Value");
            //SOCKET_OUT_VECTOR(vector, "Vector");

            NodeTitle = "Vector Math";
            NodeName  = "vector_math";

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Value", "value", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "type", "type", BocsSlotBase.BocsSlotType.Value, 0);

            bsl.List = new string[] { "add", "subtract", "average", "dot_product", "cross_product", "normalize" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotVector3(this, "Vector", "vector1", BocsSlotBase.BocsSlotType.Input));
            Slots.Add(new BocsSlotVector3(this, "Vector", "vector2", BocsSlotBase.BocsSlotType.Input));
        }
示例#15
0
 public ArmourTemplate() : base(ItemIds.WoodenStick, "ArmourTemplate")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(2, TypeName, ModTypes.Flat, StatTypes.Charm));
     HealthMods.Add(new HealthMod(2, ModTypes.Flat, TypeName, HealthTypes.Health));
     Slots.Add(EquipSlot.LeftHand);
 }
示例#16
0
        public async Task SearchAppointmentsByDateAsync_should_return_aggregate_given_appointment_exists()
        {
            var config = new AppointmentConfig()
            {
                AvailableIntervalStart = new LocalDate(2021, 5, 5),
                AvailableIntervalEnd   = new LocalDate(2021, 5, 5),
            };
            await configManager !.SaveConfigAsync(config);

            var slot = new AppointmentSlot()
            {
                From        = new LocalDateTime(2021, 5, 5, 10, 0),
                Duration    = Period.FromHours(1),
                CountOfSlot = 1,
            };

            db !.Slots.Add(slot);

            var appointment = new Appointment()
            {
                From     = new LocalDateTime(2021, 5, 5, 10, 0),
                Duration = Period.FromHours(1),
            };

            db !.Appointments.Add(appointment);
            await db !.SaveChangesAsync();

            var aggregatesForDay = await sut !.SearchAppointmentsByDateAsync(new LocalDate(2021, 5, 5));

            Assert.IsTrue(aggregatesForDay.AllSlots.First().Appointments.Any());
        }
        public BocsNodeCheckerTexture()
        {
            //NodeType* type = NodeType::add("checker_texture", create, NodeType::SHADER);

            //TEXTURE_MAPPING_DEFINE(CheckerTextureNode);

            //SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED);
            //SOCKET_IN_COLOR(color1, "Color1", make_float3(0.0f, 0.0f, 0.0f));
            //SOCKET_IN_COLOR(color2, "Color2", make_float3(0.0f, 0.0f, 0.0f));
            //SOCKET_IN_FLOAT(scale, "Scale", 1.0f);

            //SOCKET_OUT_COLOR(color, "Color");
            //SOCKET_OUT_FLOAT(fac, "Fac");

            NodeTitle = "Checker Texture";
            NodeName  = "checker_texture";

            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Fac", "fac", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));

            Slots.Add(new BocsSlotColor(this, "Color1", "color1", BocsSlotBase.BocsSlotType.Input, Color.black));
            Slots.Add(new BocsSlotColor(this, "Color2", "color2", BocsSlotBase.BocsSlotType.Input, Color.white));
            Slots.Add(new BocsSlotFloat(this, "Scale", "scale", BocsSlotBase.BocsSlotType.Input, 1));
        }
示例#18
0
        public async Task FindAppointmentSlotByIdAsync_should_return_slot_given_appointment_exists()
        {
            var slot = new AppointmentSlot()
            {
                From        = new LocalDateTime(2021, 5, 5, 10, 0),
                Duration    = Period.FromHours(1),
                CountOfSlot = 1,
            };

            db !.Slots.Add(slot);

            var appointment = new Appointment()
            {
                From     = new LocalDateTime(2021, 5, 5, 10, 0),
                Duration = Period.FromHours(1),
            };

            db !.Appointments.Add(appointment);
            await db !.SaveChangesAsync();

            var aggregate = await sut !.FindAppointmentSlotByIdAsync(slot.Id);

            Assert.IsNotNull(aggregate);
            Assert.IsTrue(aggregate.Appointments.Any());
        }
 public WoodenWarHammer() : base(ItemIds.WoodenWarHammer, "Wooden war hammer")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(4f, TypeName, ModTypes.Flat, StatTypes.Str));
     StatMods.Add(AssingStatmod.Create(-2f, TypeName, ModTypes.Flat, StatTypes.Dex));
     Slots.Add(EquipSlot.LeftHand);
 }
示例#20
0
 public WoodenStick() : base(ItemIds.WoodenStick, "Wooden stick")
 {
     desc = "Stick for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(2f, TypeName, ModTypes.Flat, StatTypes.Str));
     Slots.Add(EquipSlot.LeftHand);
     Slots.Add(EquipSlot.RightHand);
 }
示例#21
0
        public void Deserialize(BSReader reader, params object[] param)
        {
            var objectInfoType = (ObjectGeneralType)param[0];

            // This could change if other file than JMXVRES use this class
            if (objectInfoType == ObjectGeneralType.Character || objectInfoType == ObjectGeneralType.Item)
            {
                UnkUInt01    = reader.ReadUInt32();
                UnkUInt02    = reader.ReadUInt32();
                AttachMethod = reader.ReadUInt32();

                var count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    Slots.Add(new Slot()
                    {
                        Type         = (SlotType)reader.ReadUInt32(),
                        MeshSetIndex = reader.ReadUInt32(),
                    });
                }
                if (objectInfoType == ObjectGeneralType.Character)
                {
                    nComboNum = reader.ReadUInt32();
                }
            }
        }
示例#22
0
        public BocsNodeToonBsdf()
        {
            //NodeType* type = NodeType::add("toon_bsdf", create, NodeType::SHADER);

            //SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f));
            //SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL);
            //SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL);

            //static NodeEnum component_enum;
            //component_enum.insert("diffuse", CLOSURE_BSDF_DIFFUSE_TOON_ID);
            //component_enum.insert("glossy", CLOSURE_BSDF_GLOSSY_TOON_ID);
            //SOCKET_ENUM(component, "Component", component_enum, CLOSURE_BSDF_DIFFUSE_TOON_ID);
            //SOCKET_IN_FLOAT(size, "Size", 0.5f);
            //SOCKET_IN_FLOAT(smooth, "Smooth", 0.0f);

            //SOCKET_OUT_CLOSURE(BSDF, "BSDF");

            NodeTitle = "Toon BSDF";
            NodeName  = "toon_bsdf";

            Slots.Add(new BocsSlotClosure(this, "BSDF", "bsdf", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "component", "component", BocsSlotBase.BocsSlotType.Value, 0);

            bsl.List = new string[] { "diffuse", "glossy" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotColor(this, "Color", "color", BocsSlotBase.BocsSlotType.Input, Color.white));
            Slots.Add(new BocsSlotFloat(this, "Size", "size", BocsSlotBase.BocsSlotType.Input, .5f));
            Slots.Add(new BocsSlotFloat(this, "Smooth", "smooth", BocsSlotBase.BocsSlotType.Input, 0));

            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Input));
        }
 //Constructor:
 public Inventory(Image Slot, Image Selected, Image emptyIcon, Text slotNumber)
 {
     //Set defaut images
     noItemIcon      = emptyIcon;
     notSelectedIcon = Slot;
     selectedIcon    = Selected;
     //Create hotbar
     for (int i = 0; i < 10; i++)
     {
         //Create background slots
         Slots.Add(GameObject.Instantiate(Slot, Slot.transform.parent));
         Slots[i].transform.localPosition = new Vector3(-500 + 110 * i, -450, 0);
         Text temp = GameObject.Instantiate(slotNumber, slotNumber.transform.parent);
         temp.transform.localPosition = new Vector3(-470 + 110 * i, -480, 0);
         int tempNumber = i + 1;
         if (tempNumber == 10)
         {
             tempNumber = 0;
         }
         temp.text = tempNumber.ToString();
         //Create item slots
         ItemIcons.Add(GameObject.Instantiate(emptyIcon, emptyIcon.transform.parent));
         ItemIcons[i].transform.localPosition = new Vector3(-500 + 110 * i, -450, 0);
     }
     //Set selected slot to "Selected" sprite
     Slots[selected].GetComponent <Image>().sprite = selectedIcon.sprite;
 }
        public Slot Register(Item item)
        {
            if (IsRegistered(item))
            {
                this.Log($"Cannot register {item}: Already registered");
                return(GetSlot(item));
            }

            if (!CanRemoveSlot() && IsFull)
            {
                this.Log($"Cannot register {item}: No free slot available");
                return(null);
            }

            this.Log($"Registering {item}");
            var slot = new Slot(item);

            if (!IsFull)
            {
                Slots.Add(slot);
                Registered?.Invoke(this, new RegisteredEventArgs(item));
                return(slot);
            }

            Unregister(FirstRemovableSlot.Item);
            Slots.Add(slot);

            Registered?.Invoke(this, new RegisteredEventArgs(item));
            return(slot);
        }
示例#25
0
 protected void RegisterSlot(IEffectSlot slot)
 {
     lock ( SyncRoot )
     {
         Slots.Add(slot);
     }
 }
示例#26
0
        public void AddItem(Point position, UIObject item, DrawPriority priority)
        {
            Slot <UIObject> slot = new Slot <UIObject>(position, item, priority);

            Insert(slot);
            Slots.Add(slot);
        }
示例#27
0
        public BocsNodeGlassBsdf()
        {
            //NodeType* type = NodeType::add("glass_bsdf", create, NodeType::SHADER);

            //SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f));
            //SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL);
            //SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL);

            //static NodeEnum distribution_enum;
            //distribution_enum.insert("sharp", CLOSURE_BSDF_SHARP_GLASS_ID);
            //distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID);
            //distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID);
            //distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID);
            //SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID);
            //SOCKET_IN_FLOAT(roughness, "Roughness", 0.0f);
            //SOCKET_IN_FLOAT(IOR, "IOR", 0.3f);

            //SOCKET_OUT_CLOSURE(BSDF, "BSDF");

            NodeTitle = "Glass BSDF";
            NodeName  = "glass_bsdf";

            Slots.Add(new BocsSlotClosure(this, "BSDF", "bsdf", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "distribution", "distribution", BocsSlotBase.BocsSlotType.Value, 2);

            bsl.List = new string[] { "sharp", "beckmann", "GGX", "Multiscatter GGX" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotColor(this, "Color", "color", BocsSlotBase.BocsSlotType.Input, Color.white));
            Slots.Add(new BocsSlotFloat(this, "Roughness", "roughness", BocsSlotBase.BocsSlotType.Input, 0));
            Slots.Add(new BocsSlotFloat(this, "IOR", "IOR", BocsSlotBase.BocsSlotType.Input, 1.45f));
            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Input));
        }
        public BocsNodeMagicTexture()
        {
            //NodeType* type = NodeType::add("magic_texture", create, NodeType::SHADER);

            //TEXTURE_MAPPING_DEFINE(MagicTextureNode);

            //SOCKET_INT(depth, "Depth", 2);

            //SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED);
            //SOCKET_IN_FLOAT(scale, "Scale", 5.0f);
            //SOCKET_IN_FLOAT(distortion, "Distortion", 1.0f);

            //SOCKET_OUT_COLOR(color, "Color");
            //SOCKET_OUT_FLOAT(fac, "Fac");

            NodeTitle = "Magic Texture";
            NodeName  = "magic_texture";

            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Fac", "fac", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotInt(this, "Depth", "depth", BocsSlotBase.BocsSlotType.Value, 2));

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));
            Slots.Add(new BocsSlotFloat(this, "Scale", "scale", BocsSlotBase.BocsSlotType.Input, 5));
            Slots.Add(new BocsSlotFloat(this, "Distortion", "distortion", BocsSlotBase.BocsSlotType.Input, 1));
        }
示例#29
0
        private void LoadByRefelection()
        {
            AllAttributes = NodeType.GetPropertiesWithAttributeByType <GraphItemAttribute>().ToArray();
            foreach (var item in AllAttributes)
            {
                var proxy = item.Value as ConfigProxy;
                if (proxy != null)
                {
                    var c = new ConfigurationProxyConfiguration()
                    {
                        ReferenceType  = typeof(GraphItemConfiguration),
                        SourceType     = typeof(GraphItemConfiguration),
                        IsInput        = false,
                        IsOutput       = false,
                        OrderIndex     = proxy.OrderIndex,
                        Visibility     = proxy.Visibility,
                        ConfigSelector =
                            (node) => ((IEnumerable)item.Key.GetValue(node, null)).Cast <GraphItemConfiguration>()
                    };
                    GraphItemConfigurations.Add(c);
                    continue;
                }
                var slot = item.Value as Slot;
                if (slot != null)
                {
                    var result = CreateSlotConfiguration(item.Key, slot);
                    result.OrderIndex = item.Value.OrderIndex;
                    GraphItemConfigurations.Add(result);
                    Slots.Add(item.Key, slot);
                    if (result.IsOutput)
                    {
                        //Debug.Log(string.Format("Registering output {0} : {1}", result.ReferenceType, result.SourceType.Name));
                        // TODO ??

                        Container.RegisterConnectable(result.ReferenceType, result.SourceType);
                    }
                    else
                    {
                        // Debug.Log(string.Format("Registering input {0} : {1}", result.SourceType.Name, result.ReferenceType));

                        Container.RegisterConnectable(result.SourceType, result.ReferenceType);
                    }

                    continue;
                }

                var section = item.Value as Section;
                if (section != null)
                {
                    var property1 = item.Key;
                    var section1  = section;
                    var result    = CreateSectionConfiguration(property1, section1);
                    result.OrderIndex = section.OrderIndex;
                    GraphItemConfigurations.Add(result);
                }
            }

            SerializedProperties = NodeType.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.GetCustomAttributes(typeof(JsonProperty), true).Any()).ToArray();
        }
示例#30
0
        public BocsNodeEnviromentTexture()
        {
            //NodeType* type = NodeType::add("environment_texture", create, NodeType::SHADER);

            //TEXTURE_MAPPING_DEFINE(EnvironmentTextureNode);

            //SOCKET_STRING(filename, "Filename", ustring(""));

            //static NodeEnum color_space_enum;
            //color_space_enum.insert("none", NODE_COLOR_SPACE_NONE);
            //color_space_enum.insert("color", NODE_COLOR_SPACE_COLOR);
            //SOCKET_ENUM(color_space, "Color Space", color_space_enum, NODE_COLOR_SPACE_COLOR);

            //SOCKET_BOOLEAN(use_alpha, "Use Alpha", true);

            //static NodeEnum interpolation_enum;
            //interpolation_enum.insert("closest", INTERPOLATION_CLOSEST);
            //interpolation_enum.insert("linear", INTERPOLATION_LINEAR);
            //interpolation_enum.insert("cubic", INTERPOLATION_CUBIC);
            //interpolation_enum.insert("smart", INTERPOLATION_SMART);
            //SOCKET_ENUM(interpolation, "Interpolation", interpolation_enum, INTERPOLATION_LINEAR);

            //static NodeEnum projection_enum;
            //projection_enum.insert("equirectangular", NODE_ENVIRONMENT_EQUIRECTANGULAR);
            //projection_enum.insert("mirror_ball", NODE_ENVIRONMENT_MIRROR_BALL);
            //SOCKET_ENUM(projection, "Projection", projection_enum, NODE_ENVIRONMENT_EQUIRECTANGULAR);

            //SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_POSITION);

            //SOCKET_OUT_COLOR(color, "Color");
            //SOCKET_OUT_FLOAT(alpha, "Alpha");

            NodeTitle = "Enviroment Texture";
            NodeName  = "environment_texture";

            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Alpha", "alpha", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotTexture(this, "Image", "filename", BocsSlotBase.BocsSlotType.Value));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "color_space", "color_space", BocsSlotBase.BocsSlotType.Value, 1);

            bsl.List = new string[] { "none", "color" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotBool(this, "Use Alpha", "use_alpha", BocsSlotBase.BocsSlotType.Value, true));

            BocsSlotStringList bsl1 = new BocsSlotStringList(this, "interpolation", "interpolation", BocsSlotBase.BocsSlotType.Value, 1);

            bsl1.List = new string[] { "closest", "linear", "cubic", "smart" };
            Slots.Add(bsl1);

            BocsSlotStringList bsl2 = new BocsSlotStringList(this, "projection", "projection", BocsSlotBase.BocsSlotType.Value, 0);

            bsl2.List = new string[] { "equirectangular", "mirror_ball" };
            Slots.Add(bsl2);

            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));
        }