public override void Draw(HouseRenderState state, HouseBatch batch) { //ZBuffer batch.Draw(Sprite); //batch.DrawZ(Texture, ZBuffer, new Microsoft.Xna.Framework.Rectangle(0, 0, Texture.Width, Texture.Height), Color.White); }
public override void Draw(HouseRenderState state, HouseBatch batch) { if (!m_Active) { return; } if (m_Dirty) { if (FloorStyle == 0) { m_Active = false; return; } var floorStyle = ArchitectureCatalog.GetFloor(FloorStyle); if (floorStyle == null) { m_Active = false; return; } var position = state.TileToScreen(Position); PaintCoords = new Rectangle((int)position.X, (int)position.Y, state.CellWidth, state.CellHeight); Texture = floorStyle.GetTexture(state.Zoom, state.Rotation); m_Dirty = false; } batch.Draw(new HouseBatchSprite { Pixel = Texture, DestRect = PaintCoords, SrcRect = new Rectangle(0, 0, Texture.Width, Texture.Height), RenderMode = HouseBatchRenderMode.NO_DEPTH }); //batch.Draw(Texture, PaintCoords, Color.White); }
public override void Draw(HouseRenderState state, HouseBatch batch) { var position = state.TileToScreen(Position); if ((WallInfo.Segments & WallSegments.BottomLeft) == WallSegments.BottomLeft) { var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomLeftPattern); if (wall != null) { var tx = wall.Far.RightTexture; //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White); //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White); } } if ((WallInfo.Segments & WallSegments.BottomRight) == WallSegments.BottomRight) { var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomRightPattern); if (wall != null) { var tx = wall.Far.LeftTexture; //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White); //batch.Draw(tx, new Rectangle((int)position.X + 16, (int)position.Y - 49, 16, 67), Color.White); } } //if ((WallInfo.Segments & WallSegments.BottomRight) == WallSegments.BottomRight) //{ // var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomRightPattern); // if (wall != null) // { // var tx = wall.Far.LeftTexture; // //batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 49, 16, 67), Color.White); // batch.Draw(tx, new Rectangle((int)position.X + 16, (int)position.Y - 49, 16, 67), Color.White); // } //} //if ((WallInfo.Segments & WallSegments.BottomRight) == WallSegments.BottomRight) //{ // var wall = ArchitectureCatalog.GetWallPattern(WallInfo.BottomLeftPattern); // if (wall != null) // { // var tx = wall.Far.LeftTexture; // batch.Draw(tx, new Rectangle((int)position.X, (int)position.Y - 58, 16, 67), Color.White); // } //} }
public override void Draw(HouseRenderState state, HouseBatch batch) { }
public Dictionary <string, object> Batch([FromBody] HouseBatch batch) { if (ModelState.IsValid) { if (batch.ModelList.Count == 0) { result["code"] = "failed"; message.Add("至少输入一个房号"); } else if (batch.EndBuilding <= batch.StartBuilding) { result["code"] = "failed"; message.Add("结束栋数必须大于起始栋数"); } else if (batch.EndUnit <= batch.StartUnit) { result["code"] = "failed"; message.Add("结束单元必须大于起始单元"); } else { var a = from b in batch.ModelList group b by b.HouseNo into g select new { no = g.Key, count = g.Count() }; if (a.Count(w => w.count > 1) > 0) { result["code"] = "failed"; message.Add("不能有相同的房号"); } else if (db.Estates.Count(w => w.EstateId == batch.EstateId) == 0) { result["code"] = "failed"; message.Add("选择的小区不存在"); } else { //在这里开始批量创建房子 for (int i = batch.StartBuilding; i <= batch.EndBuilding; i++) { for (int j = batch.StartUnit; j <= batch.EndUnit; j++) { for (int k = batch.StartFloor; k <= batch.EndFloor; k++) { foreach (HouseModel m in batch.ModelList) { //在这里创建单个房子 House house = new House(); house.EstateId = batch.EstateId; house.HouseType = batch.HouseType; house.Building = i; house.Unit = j; house.Floor = k; house.No = m.HouseNo; house.HouseNo = string.Format("{0}-{1}-{2}-{3}", i, j, k, m.HouseNo); house.Model = m.Model; house.Structure = batch.Structure; house.Floorage = m.Floorage; house.ContactTel = batch.ContactTel; house.IsPlace = batch.IsPlace; house.HandDate = batch.HandDate; house.EmptyState = batch.EmptyState; house.News = batch.News; db.Houses.Add(house); } } } } try { db.SaveChanges(); } catch (Exception e) { result["code"] = "failed"; message.Add(e.Message); message.Add("本小区存在房号重复,请查验."); } } } result["message"] = message; } else { result["code"] = "failed"; message = GetErrorMessage(ModelState.Values); if (message.Count == 0) { message.Add("参数未填写完整"); } result["message"] = message; } return(result); }
public abstract void Draw(HouseRenderState state, HouseBatch batch);