Пример #1
0
		public bool CanPlace(System.Collections.Generic.ICollection<DesignItem> childItems, PlacementType type, PlacementAlignment position)
		{
			return type == PlacementType.Resize &&
				(position == PlacementAlignment.Right
				 || position == PlacementAlignment.BottomRight
				 || position == PlacementAlignment.Bottom);
		}
Пример #2
0
        public static PlacementSettings[] GetPlacement(this ContentTypeDefinition contentTypeDefinition, PlacementType placementType) {
            var currentSettings = contentTypeDefinition.Settings;
            string placement;
            var serializer = new JavaScriptSerializer();

            currentSettings.TryGetValue("ContentTypeSettings.Placement." + placementType, out placement);

            return String.IsNullOrEmpty(placement) ? new PlacementSettings[0] : serializer.Deserialize<PlacementSettings[]>(placement);
        }
Пример #3
0
        /// <summary>
        /// Removes any custom placement for a specific shape
        /// </summary>
        public static ContentTypeDefinitionBuilder ResetPlacement(this ContentTypeDefinitionBuilder builder, PlacementType placementType, string shapeType, string differentiator) {
            var serializer = new JavaScriptSerializer();
            var placementSettings = GetPlacement(builder.Build(), placementType).ToList();

            placementSettings = placementSettings.Where(x => x.ShapeType != shapeType && x.Differentiator != differentiator).ToList();
            
            var placement = serializer.Serialize(placementSettings.ToArray());

            return builder.WithSetting("ContentTypeSettings.Placement." + placementType, placement);
        }
Пример #4
0
        private static string AddPlacement(ContentTypeDefinition builder, PlacementType placementType, string shapeType, string differentiator, string zone, string position) {
            var serializer = new JavaScriptSerializer();
            var placementSettings = GetPlacement(builder, placementType).ToList();

            placementSettings = placementSettings.Where(x => !x.IsSameAs(new PlacementSettings { ShapeType = shapeType, Differentiator = differentiator })).ToList();

            placementSettings.Add(new PlacementSettings {
                ShapeType = shapeType,
                Differentiator = differentiator,
                Zone = zone,
                Position = position
            });

            var placement = serializer.Serialize(placementSettings.ToArray());
            return placement;
        }
Пример #5
0
 public RoomTemplate(PlacementType type, RoomTile[,] template, RoomTile[,] accessories)
 {
     PlacementType = type;
     Template = template;
     Accessories = accessories;
     CanRotate = true;
     Probability = 1.0f;
     Rotation = 0.0f;
 }
		public virtual bool CanPlace(IEnumerable<DesignItem> childItems, PlacementType type, PlacementAlignment position)
		{
			return true;
		}
Пример #7
0
 /// <summary>
 /// Adds a placement the string representation of a placement
 /// </summary>
 public static ContentTypeDefinition ResetPlacement(this ContentTypeDefinition builder, PlacementType placementType) {
     builder.Settings["ContentTypeSettings.Placement." + placementType] = String.Empty;
     return builder;
 }
Пример #8
0
 /// <summary>
 /// Removes any custom placement
 /// </summary>
 public static ContentTypeDefinitionBuilder ResetPlacement(this ContentTypeDefinitionBuilder builder, PlacementType placementType) {
     return builder.WithSetting("ContentTypeSettings.Placement." + placementType, String.Empty);
 }
Пример #9
0
        public void SetPlacementType(PlacementType pacementType)
        {
            string placementTypeString = null;
            switch (placementType)
            {
                case PlacementType.Inline:
                    placementTypeString = Const.PlacementTypeInline;
                    break;
                case PlacementType.Interstitial:
                    placementTypeString = Const.PlacementTypeInterstitial;
                    break;
            }

            string js = string.Format("mraid.setPlacementType(\"{0}\");", placementTypeString);
            EvalJS(js);
        }
Пример #10
0
		public virtual bool CanPlace(ICollection<DesignItem> childItems, PlacementType type, PlacementAlignment position)
		{
			return true;
		}
Пример #11
0
 /// <summary>
 /// Adds a placement the string representation of a placement
 /// </summary>
 public static ContentTypeDefinition Placement(this ContentTypeDefinition builder, PlacementType placementType, string shapeType, string differentiator, string zone, string position) {
     var placement = AddPlacement(builder, placementType, shapeType, differentiator, zone, position);
     builder.Settings["ContentTypeSettings.Placement." + placementType] = placement;
     return builder;
 }
Пример #12
0
 /// <summary>
 /// Defines a custom placement
 /// </summary>
 public static ContentTypeDefinitionBuilder Placement(this ContentTypeDefinitionBuilder builder, PlacementType placementType, string shapeType, string differentiator, string zone, string position) {
     var placement = AddPlacement(builder.Build(), placementType, shapeType, differentiator, zone, position);
     return builder.WithSetting("ContentTypeSettings.Placement." + placementType, placement);
 }
Пример #13
0
 public Gene(GeneType _type, int _count, PlacementType _palcement, int _compAbilityStat)
 {
     initGene(_type, _count, _palcement, _compAbilityStat);
 }
Пример #14
0
        private void initGene(GeneType _type, int _count, PlacementType _palcement, int _compAbilityStat)
        {
            type = _type;
            count = _count;
            placement = _palcement;
            compAbilityStat = _compAbilityStat;

            IncrementGeneCounter();
        }
Пример #15
0
		public bool CanPlace(IEnumerable<DesignItem> childItems, PlacementType type, PlacementAlignment position)
		{
			return type == PlacementType.Resize && (position == PlacementAlignment.Right || position == PlacementAlignment.BottomRight || position == PlacementAlignment.Bottom);
		}