public BreakableBody(BodyMaterial mat, GameScene scene) : base() { material = mat; this.scene = scene; Layer = SpriteLayer.LAYER1; EventManager.Get.RegisterListner(this); }
public static void PlayHitSFXForMaterial(BodyMaterial material) { switch (material) { case BodyMaterial.WOOD: AudioQueue.PlayOnce("Sounds/Hit_Wood_0" + BaseGame.Random.Next(1, 3)); break; case BodyMaterial.GLASS: AudioQueue.PlayOnce("Sounds/Hit_Glass_0" + BaseGame.Random.Next(1, 3)); break; case BodyMaterial.CONCRETE: AudioQueue.PlayOnce("Sounds/Hit_Concrete_0" + BaseGame.Random.Next(1, 5)); break; } }
public static void PlaySFXBreakForMaterial(BodyMaterial material) { switch (material) { case BodyMaterial.WOOD: AudioQueue.PlayOnce("Sounds/Break_Wood_01"); // + BaseGame.Random.Next(1, 3)); break; case BodyMaterial.GLASS: AudioQueue.PlayOnce("Sounds/Break_Glass_01"); break; case BodyMaterial.CONCRETE: AudioQueue.PlayOnce("Sounds/Break_Concrete_01"); break; } }
public static void PlaySFXBreakForMaterial(BodyMaterial material) { switch (material) { case BodyMaterial.WOOD: AudioQueue.PlayOnce("Sounds/Break_Wood_01");// + BaseGame.Random.Next(1, 3)); break; case BodyMaterial.GLASS: AudioQueue.PlayOnce("Sounds/Break_Glass_01"); break; case BodyMaterial.CONCRETE: AudioQueue.PlayOnce("Sounds/Break_Concrete_01"); break; } }
public override void UpdateNodes() { Fitting fittingAlias = null; FittingType typeAlias = null; FittingVMNode resultAlias = null; Diameter diameterAlias = null; Pressure pressureAlias = null; ConnectionType connectionTypeAlias = null; BodyMaterial bodyMaterialAlias = null; PriceItem pricePriceItemAlias = null; PriceItem datePriceItemAlias = null; Price pricePriceAlias = null; Price datePriceAlias = null; Provider providerAlias = null; var dateSubQuery = QueryOver.Of <PriceItem> (() => datePriceItemAlias) .JoinAlias(c => c.Price, () => datePriceAlias) .Where(() => datePriceItemAlias.Fitting.Id == fittingAlias.Id) .Where(() => datePriceAlias.Provider.Id == pricePriceAlias.Provider.Id) .Select(Projections.SqlFunction( new SQLFunctionTemplate(NHibernateUtil.String, "SUBSTRING_INDEX(?1, ?2, ?3)"), NHibernateUtil.Int32, Projections.SqlFunction( new SQLFunctionTemplate(NHibernateUtil.String, "GROUP_CONCAT( ?1 ORDER BY ?2)"), NHibernateUtil.String, Projections.Property(() => datePriceAlias.Id), Projections.Property(() => datePriceAlias.Date)), Projections.Constant(","), Projections.Constant(-1) )); var priceSubQuery = QueryOver.Of <PriceItem> (() => pricePriceItemAlias) .JoinAlias(c => c.Price, () => pricePriceAlias) .JoinAlias(() => pricePriceAlias.Provider, () => providerAlias) .Where(() => pricePriceItemAlias.Fitting.Id == fittingAlias.Id) .WithSubquery.WhereProperty(() => pricePriceAlias.Id).In(dateSubQuery) .Select(Projections.SqlFunction( new SQLFunctionTemplate(NHibernateUtil.String, "GROUP_CONCAT( ?1 SEPARATOR ?2)"), NHibernateUtil.String, Projections.SqlFunction("CONCAT", NHibernateUtil.String, Projections.Property(() => providerAlias.Name), Projections.Constant(" - "), Projections.Property(() => pricePriceItemAlias.Cost), Projections.Constant(" "), Projections.Property(() => pricePriceItemAlias.Currency), Projections.Constant(" ("), Projections.SqlFunction( new SQLFunctionTemplate(NHibernateUtil.String, "DATE_FORMAT( ?1, ?2)"), NHibernateUtil.String, Projections.Property(() => pricePriceAlias.Date), Projections.Constant("%d.%m.%Y") ), Projections.Constant(")") ), Projections.Constant("\n"))) .Take(1); var fittingQuery = UoW.Session.QueryOver <Fitting> (() => fittingAlias) .JoinAlias(c => c.Name, () => typeAlias) .JoinAlias(c => c.Diameter, () => diameterAlias) .JoinAlias(c => c.Pressure, () => pressureAlias) .JoinAlias(c => c.ConnectionType, () => connectionTypeAlias) .JoinAlias(c => c.BodyMaterial, () => bodyMaterialAlias, NHibernate.SqlCommand.JoinType.LeftOuterJoin); if (Filter.RestrictFittingType != null) { fittingQuery.Where(() => fittingAlias.Name.Id == Filter.RestrictFittingType.Id); } if (Filter.RestrictBodyMaterial != null) { fittingQuery.Where(() => fittingAlias.BodyMaterial.Id == Filter.RestrictBodyMaterial.Id); } if (Filter.RestrictConnectionType != null) { fittingQuery.Where(() => fittingAlias.ConnectionType.Id == Filter.RestrictConnectionType.Id); } if (Filter.RestrictDiameter != null) { fittingQuery.Where(() => fittingAlias.Diameter.Id == Filter.RestrictDiameter.Id); } if (Filter.RestrictPressure != null) { fittingQuery.Where(() => fittingAlias.Pressure.Id == Filter.RestrictPressure.Id); } if (!String.IsNullOrEmpty(Filter.RestrictModel)) { fittingQuery.Where(() => fittingAlias.Code == Filter.RestrictModel); } var fittinglist = fittingQuery.SelectList(list => list .Select(() => fittingAlias.Id).WithAlias(() => resultAlias.Id) .Select(() => typeAlias.NameRus).WithAlias(() => resultAlias.Name) .Select(() => diameterAlias.Inch).WithAlias(() => resultAlias.DiameterInch) .Select(() => diameterAlias.DN).WithAlias(() => resultAlias.DiameterMm) .Select(() => fittingAlias.DiameterUnits).WithAlias(() => resultAlias.DiameterUnits) .Select(() => pressureAlias.Pn).WithAlias(() => resultAlias.PressurePn) .Select(() => pressureAlias.Pclass).WithAlias(() => resultAlias.PressurePclass) .Select(() => fittingAlias.PressureUnits).WithAlias(() => resultAlias.PressureUnits) .Select(() => connectionTypeAlias.NameRus).WithAlias(() => resultAlias.ConnectionType) .Select(() => bodyMaterialAlias.NameRus).WithAlias(() => resultAlias.BodyMaterial) .Select(() => fittingAlias.Code).WithAlias(() => resultAlias.Code) .Select(() => fittingAlias.Note).WithAlias(() => resultAlias.Note) .SelectSubQuery(priceSubQuery).WithAlias(() => resultAlias.ProvidersPrice) ) .TransformUsing(Transformers.AliasToBean <FittingVMNode>()) .List <FittingVMNode>(); SetItemsSource(fittinglist); }