| @@ -9,7 +9,7 @@ namespace GameClass.GameObj | |||
| public class Doorway : GameObj | |||
| { | |||
| public Doorway(XY initPos) : | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.Doorway) | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Null, GameObjType.Doorway) | |||
| { | |||
| this.CanMove = false; | |||
| } | |||
| @@ -9,7 +9,7 @@ namespace GameClass.GameObj | |||
| public class EmergencyExit : GameObj | |||
| { | |||
| public EmergencyExit(XY initPos) : | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.EmergencyExit) | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Null, GameObjType.EmergencyExit) | |||
| { | |||
| this.CanMove = false; | |||
| } | |||
| @@ -8,7 +8,7 @@ namespace GameClass.GameObj | |||
| public class Generator : GameObj | |||
| { | |||
| public Generator(XY initPos) : | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.Generator) | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Null, GameObjType.Generator) | |||
| { | |||
| this.CanMove = false; | |||
| } | |||
| @@ -22,19 +22,11 @@ namespace GameClass.GameObj | |||
| { | |||
| try | |||
| { | |||
| uint type = ProtoGameMap[obj.Position.x / GameData.numOfPosGridPerCell, obj.Position.y / GameData.numOfPosGridPerCell]; | |||
| if (type == 2) | |||
| return PlaceType.Grass1; | |||
| else if (type == 3) | |||
| return PlaceType.Grass2; | |||
| else if (type == 4) | |||
| return PlaceType.Grass3; | |||
| else | |||
| return PlaceType.Land; // 其他情况均返回land | |||
| return (PlaceType)ProtoGameMap[obj.Position.x / GameData.numOfPosGridPerCell, obj.Position.y / GameData.numOfPosGridPerCell]; | |||
| } | |||
| catch | |||
| { | |||
| return PlaceType.Land; | |||
| return PlaceType.Null; | |||
| } | |||
| } | |||
| @@ -42,21 +34,11 @@ namespace GameClass.GameObj | |||
| { | |||
| try | |||
| { | |||
| switch (ProtoGameMap[pos.x / GameData.numOfPosGridPerCell, pos.y / GameData.numOfPosGridPerCell]) | |||
| { | |||
| case 2: | |||
| return PlaceType.Grass1; | |||
| case 3: | |||
| return PlaceType.Grass2; | |||
| case 4: | |||
| return PlaceType.Grass3; | |||
| default: | |||
| return PlaceType.Land; | |||
| } | |||
| return (PlaceType)ProtoGameMap[pos.x / GameData.numOfPosGridPerCell, pos.y / GameData.numOfPosGridPerCell]; | |||
| } | |||
| catch | |||
| { | |||
| return PlaceType.Land; | |||
| return PlaceType.Null; | |||
| } | |||
| } | |||
| @@ -114,7 +96,7 @@ namespace GameClass.GameObj | |||
| { | |||
| switch (mapResource[i, j]) | |||
| { | |||
| case (uint)MapInfoObjType.Wall: | |||
| case (uint)PlaceType.Wall: | |||
| { | |||
| GameObjLockDict[GameObjType.Wall].EnterWriteLock(); | |||
| try | |||
| @@ -127,7 +109,7 @@ namespace GameClass.GameObj | |||
| } | |||
| break; | |||
| } | |||
| case (uint)MapInfoObjType.Doorway: | |||
| case (uint)PlaceType.Doorway: | |||
| { | |||
| GameObjLockDict[GameObjType.Doorway].EnterWriteLock(); | |||
| try | |||
| @@ -141,7 +123,7 @@ namespace GameClass.GameObj | |||
| break; | |||
| } | |||
| case (uint)MapInfoObjType.EmergencyExit: | |||
| case (uint)PlaceType.EmergencyExit: | |||
| { | |||
| GameObjLockDict[GameObjType.EmergencyExit].EnterWriteLock(); | |||
| try | |||
| @@ -154,7 +136,7 @@ namespace GameClass.GameObj | |||
| } | |||
| break; | |||
| } | |||
| case (uint)MapInfoObjType.Generator: | |||
| case (uint)PlaceType.Generator: | |||
| { | |||
| GameObjLockDict[GameObjType.Generator].EnterWriteLock(); | |||
| try | |||
| @@ -167,11 +149,11 @@ namespace GameClass.GameObj | |||
| } | |||
| break; | |||
| } | |||
| case (uint)MapInfoObjType.BirthPoint1: | |||
| case (uint)MapInfoObjType.BirthPoint2: | |||
| case (uint)MapInfoObjType.BirthPoint3: | |||
| case (uint)MapInfoObjType.BirthPoint4: | |||
| case (uint)MapInfoObjType.BirthPoint5: | |||
| case (uint)PlaceType.BirthPoint1: | |||
| case (uint)PlaceType.BirthPoint2: | |||
| case (uint)PlaceType.BirthPoint3: | |||
| case (uint)PlaceType.BirthPoint4: | |||
| case (uint)PlaceType.BirthPoint5: | |||
| { | |||
| birthPointList.Add(mapResource[i, j], GameData.GetCellCenterPos(i, j)); | |||
| break; | |||
| @@ -8,7 +8,7 @@ namespace GameClass.GameObj | |||
| public class Wall : GameObj | |||
| { | |||
| public Wall(XY initPos) : | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.Wall) | |||
| base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Null, GameObjType.Wall) | |||
| { | |||
| this.CanMove = false; | |||
| } | |||
| @@ -9,7 +9,7 @@ namespace GameClass.GameObj | |||
| public class OutOfBoundBlock : GameObj, IOutOfBound | |||
| { | |||
| public OutOfBoundBlock(XY initPos) : | |||
| base(initPos, int.MaxValue, PlaceType.Land, GameObjType.OutOfBoundBlock) | |||
| base(initPos, int.MaxValue, PlaceType.Null, GameObjType.OutOfBoundBlock) | |||
| { | |||
| this.CanMove = false; | |||
| } | |||
| @@ -22,7 +22,7 @@ namespace GameClass.GameObj | |||
| public abstract PropType GetPropType(); | |||
| public Prop(XY initPos, int radius = GameData.PropRadius) : | |||
| base(initPos, radius, PlaceType.Land, GameObjType.Prop) | |||
| base(initPos, radius, PlaceType.Null, GameObjType.Prop) | |||
| { | |||
| this.CanMove = false; | |||
| this.moveSpeed = GameData.PropMoveSpeed; | |||
| @@ -89,7 +89,7 @@ namespace GameClass.Skill // 被动技能开局时就释放,持续到游戏 | |||
| { | |||
| lastPlace = nowPlace; | |||
| nowPlace = player.Place; | |||
| if ((lastPlace == PlaceType.Grass1 || lastPlace == PlaceType.Grass2 || lastPlace == PlaceType.Grass3) && nowPlace == PlaceType.Land) | |||
| if ((lastPlace == PlaceType.Grass) && nowPlace == PlaceType.Null) | |||
| { | |||
| if (!speedup) | |||
| { | |||
| @@ -234,7 +234,7 @@ namespace Gaming | |||
| { | |||
| for (int j = 0; j < gameMap.ProtoGameMap.GetLength(1); j++) | |||
| { | |||
| if (gameMap.ProtoGameMap[i, j] == (int)MapInfoObjType.Null) | |||
| if (gameMap.ProtoGameMap[i, j] == (int)PlaceType.Null) | |||
| { | |||
| availableCellForGenerateProp.Add(GameData.GetCellCenterPos(i, j)); | |||
| } | |||
| @@ -42,14 +42,6 @@ namespace Preparation.Utility | |||
| Circle = 1, // 子弹和人物为圆形,格子为方形 | |||
| Square = 2 | |||
| } | |||
| public enum PlaceType // 位置标志,包括陆地,草丛。游戏中每一帧都要刷新各个物体的该属性 | |||
| { | |||
| Null = 0, | |||
| Land = 1, | |||
| Grass1 = 2, | |||
| Grass2 = 3, | |||
| Grass3 = 4, | |||
| } | |||
| public enum BulletType // 子弹类型 | |||
| { | |||
| Null = 0, | |||
| @@ -108,7 +100,7 @@ namespace Preparation.Utility | |||
| Spear = 4 | |||
| } | |||
| public enum MapInfoObjType | |||
| public enum PlaceType | |||
| { | |||
| Null = 0, | |||
| BirthPoint1 = 1,//必须从1开始 | |||
| @@ -77,23 +77,23 @@ namespace Server | |||
| } | |||
| switch (player.Place) | |||
| { | |||
| case Preparation.Utility.PlaceType.Land: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlaceType.Land; | |||
| case Preparation.Utility.PlacccceType.Land: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlacccceType.Land; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass1: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlaceType.Grass1; | |||
| case Preparation.Utility.PlacccceType.Grass1: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlacccceType.Grass1; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass2: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlaceType.Grass2; | |||
| case Preparation.Utility.PlacccceType.Grass2: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlacccceType.Grass2; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass3: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlaceType.Grass3; | |||
| case Preparation.Utility.PlacccceType.Grass3: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlacccceType.Grass3; | |||
| break; | |||
| // case Preparation.Utility.PlaceType.Invisible: | |||
| // msg.MessageOfCharacter.Place = Communication.Proto.PlaceType.Invisible; | |||
| // case Preparation.Utility.PlacccceType.Invisible: | |||
| // msg.MessageOfCharacter.Place = Communication.Proto.PlacccceType.Invisible; | |||
| // break; | |||
| default: | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlaceType.NullPlaceType; | |||
| msg.MessageOfCharacter.Place = Communication.Proto.PlacccceType.NullPlaceType; | |||
| break; | |||
| } | |||
| @@ -212,20 +212,20 @@ namespace Server | |||
| msg.MessageOfBullet.ParentTeamID = bullet.Parent.TeamID; | |||
| switch (bullet.Place) | |||
| { | |||
| case Preparation.Utility.PlaceType.Land: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlaceType.Land; | |||
| case Preparation.Utility.PlacccceType.Land: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlacccceType.Land; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass1: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlaceType.Grass1; | |||
| case Preparation.Utility.PlacccceType.Grass1: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlacccceType.Grass1; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass2: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlaceType.Grass2; | |||
| case Preparation.Utility.PlacccceType.Grass2: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlacccceType.Grass2; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass3: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlaceType.Grass3; | |||
| case Preparation.Utility.PlacccceType.Grass3: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlacccceType.Grass3; | |||
| break; | |||
| default: | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlaceType.NullPlaceType; | |||
| msg.MessageOfBullet.Place = Communication.Proto.PlacccceType.NullPlaceType; | |||
| break; | |||
| } | |||
| return msg; | |||
| @@ -271,20 +271,20 @@ namespace Server | |||
| } | |||
| switch (prop.Place) | |||
| { | |||
| case Preparation.Utility.PlaceType.Land: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlaceType.Land; | |||
| case Preparation.Utility.PlacccceType.Land: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlacccceType.Land; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass1: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlaceType.Grass1; | |||
| case Preparation.Utility.PlacccceType.Grass1: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlacccceType.Grass1; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass2: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlaceType.Grass2; | |||
| case Preparation.Utility.PlacccceType.Grass2: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlacccceType.Grass2; | |||
| break; | |||
| case Preparation.Utility.PlaceType.Grass3: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlaceType.Grass3; | |||
| case Preparation.Utility.PlacccceType.Grass3: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlacccceType.Grass3; | |||
| break; | |||
| default: | |||
| msg.MessageOfProp.Place = Communication.Proto.PlaceType.NullPlaceType; | |||
| msg.MessageOfProp.Place = Communication.Proto.PlacccceType.NullPlaceType; | |||
| break; | |||
| } | |||
| return msg; | |||