commit c0acfb22669fa4bbf5c6efdb3888f0fe7ebeb885 Author: Mootfrost777 Date: Wed Jul 6 12:47:50 2022 +0300 Started refactoring diff --git a/.vs/Pacman_refactored/DesignTimeBuild/.dtbcache.v2 b/.vs/Pacman_refactored/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..41756fa Binary files /dev/null and b/.vs/Pacman_refactored/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Pacman_refactored/FileContentIndex/1706fc93-7d12-4422-a082-51fd8c75d993.vsidx b/.vs/Pacman_refactored/FileContentIndex/1706fc93-7d12-4422-a082-51fd8c75d993.vsidx new file mode 100644 index 0000000..493f40e Binary files /dev/null and b/.vs/Pacman_refactored/FileContentIndex/1706fc93-7d12-4422-a082-51fd8c75d993.vsidx differ diff --git a/.vs/Pacman_refactored/FileContentIndex/56d750ff-2091-43eb-9532-36da90a91147.vsidx b/.vs/Pacman_refactored/FileContentIndex/56d750ff-2091-43eb-9532-36da90a91147.vsidx new file mode 100644 index 0000000..735a661 Binary files /dev/null and b/.vs/Pacman_refactored/FileContentIndex/56d750ff-2091-43eb-9532-36da90a91147.vsidx differ diff --git a/.vs/Pacman_refactored/FileContentIndex/83f76569-efa3-4697-8f06-1197d9a6dcdb.vsidx b/.vs/Pacman_refactored/FileContentIndex/83f76569-efa3-4697-8f06-1197d9a6dcdb.vsidx new file mode 100644 index 0000000..3270abc Binary files /dev/null and b/.vs/Pacman_refactored/FileContentIndex/83f76569-efa3-4697-8f06-1197d9a6dcdb.vsidx differ diff --git a/.vs/Pacman_refactored/FileContentIndex/e78822c6-a2fb-4d7c-8382-b8d581b1c791.vsidx b/.vs/Pacman_refactored/FileContentIndex/e78822c6-a2fb-4d7c-8382-b8d581b1c791.vsidx new file mode 100644 index 0000000..ddfd93b Binary files /dev/null and b/.vs/Pacman_refactored/FileContentIndex/e78822c6-a2fb-4d7c-8382-b8d581b1c791.vsidx differ diff --git a/.vs/Pacman_refactored/FileContentIndex/read.lock b/.vs/Pacman_refactored/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/Pacman_refactored/v16/.suo b/.vs/Pacman_refactored/v16/.suo new file mode 100644 index 0000000..b84a9c7 Binary files /dev/null and b/.vs/Pacman_refactored/v16/.suo differ diff --git a/.vs/Pacman_refactored/v17/.suo b/.vs/Pacman_refactored/v17/.suo new file mode 100644 index 0000000..a0862d9 Binary files /dev/null and b/.vs/Pacman_refactored/v17/.suo differ diff --git a/.vs/ProjectEvaluation/pacman_refactored.metadata.v3 b/.vs/ProjectEvaluation/pacman_refactored.metadata.v3 new file mode 100644 index 0000000..c922213 Binary files /dev/null and b/.vs/ProjectEvaluation/pacman_refactored.metadata.v3 differ diff --git a/.vs/ProjectEvaluation/pacman_refactored.projects.v3 b/.vs/ProjectEvaluation/pacman_refactored.projects.v3 new file mode 100644 index 0000000..d99f19d Binary files /dev/null and b/.vs/ProjectEvaluation/pacman_refactored.projects.v3 differ diff --git a/Pacman_refactored.sln b/Pacman_refactored.sln new file mode 100644 index 0000000..e7a55bd --- /dev/null +++ b/Pacman_refactored.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32413.511 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pacman_refactored", "Pacman_refactored\Pacman_refactored.csproj", "{8C511935-ED5F-4850-8EF4-32058A50A89E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8C511935-ED5F-4850-8EF4-32058A50A89E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C511935-ED5F-4850-8EF4-32058A50A89E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C511935-ED5F-4850-8EF4-32058A50A89E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C511935-ED5F-4850-8EF4-32058A50A89E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {304ACC20-0C3E-47DF-944D-1ACAC4A8B857} + EndGlobalSection +EndGlobal diff --git a/Pacman_refactored/.gitignore b/Pacman_refactored/.gitignore new file mode 100644 index 0000000..2824132 --- /dev/null +++ b/Pacman_refactored/.gitignore @@ -0,0 +1,65 @@ +#OS junk files +[Tt]humbs.db +*.DS_Store + +#Visual Studio files +*.pidb +*.userprefs +*.[Oo]bj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*.vssscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.[Cc]ache +*.ilk +*.log +*.lib +*.sbr +*.sdf +*.lock +*.ide +*.ide-shm +*.ide-wal +ipch/ +obj/ +[Bb]in +[Dd]ebug*/ +[Rr]elease*/ +Ankh.NoLoad + +#Tooling +_ReSharper*/ +*.resharper +[Tt]est[Rr]esult* + +#Project files +[Bb]uild/ + +#Subversion files +.svn + +# Office Temp Files +~$* + +#monodroid private beta +monodroid*.msi +/CompiledContent/Android/IgnoreMe.dll +/CompiledContent/OSX/IgnoreMe.dll +/CompiledContent/Windows8/IgnoreMe.dll +/CompiledContent/Windows/IgnoreMe.dll +*.cachefile +*.dll +*.VC.db +*.VC.opendb + +artifacts/ \ No newline at end of file diff --git a/Pacman_refactored/Classes/Entity.cs b/Pacman_refactored/Classes/Entity.cs new file mode 100644 index 0000000..87f819c --- /dev/null +++ b/Pacman_refactored/Classes/Entity.cs @@ -0,0 +1,50 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +using Pacman_refactored.Classes.Interfaces; +using System.Runtime.CompilerServices; + +namespace Pacman_refactored.Classes +{ + public abstract class Entity : IMovable, IRotatable, IAnimate + { + public abstract Texture2D Texture { get; set; } + + public abstract Vector2 Position { get; set; } + public abstract Direction Direction { get; set; } + public abstract float Rotation { get; set; } + + public abstract int[] StartPosition { get; set; } + + public abstract float Speed { get; set; } + public abstract bool IsAlive { get; set; } + + public abstract int CellSize { get; set; } + public abstract Rectangle SourceRect { get; set; } + public abstract Rectangle Boundingbox { get; set; } + + public abstract int TextureNumber { get; set; } + public abstract int TextureCount { get; set; } + + public virtual void Update(GameTime gameTime) + { + Boundingbox = new Rectangle((int)Position.X, (int)Position.Y, (int)CellSize, (int)CellSize); + IMovable.DirectionMove(Direction, Position, Speed, Game1.Map); + } + + public virtual void Draw(SpriteBatch spriteBatch) + { + Rotation = IRotatable.Rotate(Direction, Rotation); + if (Direction != Direction.None) + { + IAnimate.Animate(spriteBatch, Texture, TextureNumber, TextureCount, CellSize, Position, Rotation); + } + else + { + SourceRect = new Rectangle(new Point(0, 0), new Point(CellSize)); + spriteBatch.Draw(Texture, Position, SourceRect, Color.White, Rotation, new Vector2(CellSize / 2), 1, SpriteEffects.None, 0); + } + } + } +} diff --git a/Pacman_refactored/Classes/Enums.cs b/Pacman_refactored/Classes/Enums.cs new file mode 100644 index 0000000..0978f35 --- /dev/null +++ b/Pacman_refactored/Classes/Enums.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Pacman_refactored.Classes +{ + public enum Direction + { + Up, + Down, + Left, + Right, + None + } + + public enum GameState + { + Game, + Menu, + GameOver, + NextLevel, + HowToPlay, + Exit + } + + public enum GhostType + { + Blinky, + Pinky, + Inky, + Clyde + } +} diff --git a/Pacman_refactored/Classes/Ghost.cs b/Pacman_refactored/Classes/Ghost.cs new file mode 100644 index 0000000..08ca2c5 --- /dev/null +++ b/Pacman_refactored/Classes/Ghost.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Pacman_refactored.Classes.Interfaces; + +namespace Pacman_refactored.Classes +{ + public class Ghost : Entity, IAnimate, IMovable + { + public override Texture2D Texture { get; set; } + + public override Vector2 Position { get; set; } + public override Direction Direction { get; set; } + + public override int[] StartPosition { get; set; } + + public override float Speed { get; set; } + public override bool IsAlive { get; set; } + + public override int CellSize { get; set; } + + public override Rectangle SourceRect { get; set; } + public override Rectangle Boundingbox { get; set; } + + public override int TextureNumber { get; set; } + public override int TextureCount { get; set; } + + public GhostType GhostType { get; set; } + + public Ghost(Texture2D texture, int[] startPosition, float speed, int cellSize, GhostType ghostType) + { + Texture = texture; + TextureNumber = 0; + TextureCount = Texture.Width / CellSize; + CellSize = cellSize; + StartPosition = startPosition; + Position = new Vector2(startPosition[0] * CellSize, startPosition[1] * CellSize); + Direction = Direction.None; + Speed = speed; + GhostType = ghostType; + } + } +} diff --git a/Pacman_refactored/Classes/Interfaces/IAnimate.cs b/Pacman_refactored/Classes/Interfaces/IAnimate.cs new file mode 100644 index 0000000..c59450d --- /dev/null +++ b/Pacman_refactored/Classes/Interfaces/IAnimate.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System.Collections.Generic; +using System; + +namespace Pacman_refactored.Classes.Interfaces +{ + public interface IAnimate + { + const int FramesCooldown = 10; + + static void Animate(SpriteBatch spriteBatch, Texture2D texture, + int textureNumber, int textureCount, + int cellSize, Vector2 position, + float rotation) + { + if (textureNumber == textureCount) + { + textureNumber = 0; + } + rotation = rotation * (float)Math.PI / 180; + + Rectangle sourceRect = new Rectangle(new Point(0, cellSize * textureNumber), new Point(cellSize)); + spriteBatch.Draw(texture, position, sourceRect, Color.White, rotation, new Vector2(cellSize / 2), 1, SpriteEffects.None, 0); + + textureNumber++; + } + } +} diff --git a/Pacman_refactored/Classes/Interfaces/IBoostable.cs b/Pacman_refactored/Classes/Interfaces/IBoostable.cs new file mode 100644 index 0000000..f5d1edc --- /dev/null +++ b/Pacman_refactored/Classes/Interfaces/IBoostable.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Pacman_refactored.Classes.Interfaces +{ + public interface IBoostable + { + } +} diff --git a/Pacman_refactored/Classes/Interfaces/IControl.cs b/Pacman_refactored/Classes/Interfaces/IControl.cs new file mode 100644 index 0000000..6572daf --- /dev/null +++ b/Pacman_refactored/Classes/Interfaces/IControl.cs @@ -0,0 +1,64 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System; + +namespace Pacman_refactored.Classes.Interfaces +{ + public interface IControl + { + /// + /// Get direction from input device data. + /// + /// + static Direction GetDirection() + { + GamePadState gamepadState = GamePad.GetState(0); + KeyboardState keyboardState = Keyboard.GetState(); + + bool stickUp = false; + bool stickDown = false; + bool stickLeft = false; + bool stickRight = false; + + if (Math.Abs(gamepadState.ThumbSticks.Left.Y) > Math.Abs(gamepadState.ThumbSticks.Left.X) && + Math.Abs(gamepadState.ThumbSticks.Left.Y) > 0.25f) + { + if (gamepadState.ThumbSticks.Left.Y > 0) stickUp = true; + else stickDown = true; + } + else if (Math.Abs(gamepadState.ThumbSticks.Left.X) > Math.Abs(gamepadState.ThumbSticks.Left.Y) && + Math.Abs(gamepadState.ThumbSticks.Left.X) > 0.25f) + { + if (gamepadState.ThumbSticks.Left.X > 0) stickRight = true; + else stickLeft = true; + } + + if (keyboardState.IsKeyDown(Keys.W) || + gamepadState.DPad.Up == ButtonState.Pressed || + stickUp) + { + return Direction.Up; + } + else if (keyboardState.IsKeyDown(Keys.S) || + gamepadState.DPad.Down == ButtonState.Pressed || + stickDown) + { + return Direction.Down; + } + else if (keyboardState.IsKeyDown(Keys.A) || + gamepadState.DPad.Left == ButtonState.Pressed || + stickLeft) + { + return Direction.Left; + } + else if (keyboardState.IsKeyDown(Keys.D) || + gamepadState.DPad.Right == ButtonState.Pressed || + stickRight) + { + return Direction.Right; + } + return Direction.None; + } + } +} diff --git a/Pacman_refactored/Classes/Interfaces/IMovable.cs b/Pacman_refactored/Classes/Interfaces/IMovable.cs new file mode 100644 index 0000000..bee0964 --- /dev/null +++ b/Pacman_refactored/Classes/Interfaces/IMovable.cs @@ -0,0 +1,97 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System.Collections.Generic; + +namespace Pacman_refactored.Classes.Interfaces +{ + public interface IMovable + { + /// + /// Move an entity in a given direction. + /// + /// + /// + /// + /// + static void DirectionMove(Direction direction, Vector2 position, float speed, + Map map) + { + // Move entity + if (direction == Direction.Up && map.Matrix[(int)(position.Y / map.CellSize - 0.5), (int)position.X / map.CellSize] == 0) + { + position.Y -= speed; + } + else if (direction == Direction.Right && map.Matrix[(int)position.Y / map.CellSize, (int)(position.X / map.CellSize + 0.5)] == 0) + { + position.X += speed; + } + else if (direction == Direction.Down && map.Matrix[(int)(position.Y / map.CellSize + 0.5), (int)position.X / map.CellSize] == 0) + { + position.Y += speed; + } + else if (direction == Direction.Left && map.Matrix[(int)position.Y / map.CellSize, (int)(position.X / map.CellSize - 0.5)] == 0) + { + position.X -= speed; + } + + + // Teleporters handling + foreach (var linkedTeleports in map.Teleports) + { + for (int i = 0; i < linkedTeleports.Count; i++) + { + if (linkedTeleports[i][0] == (int)position.Y / 24 && + linkedTeleports[i][1] == (int)position.X / 24) + { + if (i == 0) + { + position = new Vector2(linkedTeleports[1][0] * map.CellSize, linkedTeleports[1][1] * map.CellSize); + } + else + { + position = new Vector2(linkedTeleports[0][0] * map.CellSize, linkedTeleports[0][1] * map.CellSize); + } + } + } + } + + // Check wall collision + CheckWallCollision(direction, position, map); + } + + /// + /// Check if entity collides with wall. + /// + /// + /// + /// + /// + static Direction CheckWallCollision(Direction direction, Vector2 position, Map map) + { + // Check if entity hits into wall + if (direction == Direction.Up && map.Matrix[(int)(position.Y / map.CellSize - 0.5), (int)position.X / map.CellSize] != 0) + { + position.Y = (int)(position.Y / map.CellSize) * map.CellSize + map.CellSize / 2; + direction = Direction.None; + } + else if (direction == Direction.Right && map.Matrix[(int)position.Y / map.CellSize, (int)(position.X / map.CellSize + 0.5)] != 0) + { + position.X = (int)(position.X / map.CellSize) * map.CellSize + map.CellSize / 2; + direction = Direction.None; + } + else if (direction == Direction.Down && map.Matrix[(int)(position.Y / map.CellSize + 0.5), (int)position.X / map.CellSize] != 0) + { + position.Y = (int)(position.Y / map.CellSize) * map.CellSize + map.CellSize / 2; + direction = Direction.None; + } + else if (direction == Direction.Left && map.Matrix[(int)position.Y / map.CellSize, (int)(position.X / map.CellSize - 0.5)] != 0) + { + position.X = (int)(position.X / map.CellSize) * map.CellSize + map.CellSize / 2; + direction = Direction.None; + } + + return direction; + } + } +} diff --git a/Pacman_refactored/Classes/Interfaces/IRotatable.cs b/Pacman_refactored/Classes/Interfaces/IRotatable.cs new file mode 100644 index 0000000..a168190 --- /dev/null +++ b/Pacman_refactored/Classes/Interfaces/IRotatable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Pacman_refactored.Classes.Interfaces +{ + public interface IRotatable + { + static float Rotate(Direction direction, float currentAngle) + { + float angle = 0; + switch (direction) + { + case Direction.Up: + angle = 90; + break; + case Direction.Down: + angle = 270; + break; + case Direction.Left: + angle = 180; + break; + case Direction.Right: + angle = 0; + break; + default: + angle = currentAngle; + break; + } + return angle; + } + } +} diff --git a/Pacman_refactored/Classes/Map.cs b/Pacman_refactored/Classes/Map.cs new file mode 100644 index 0000000..5405f18 --- /dev/null +++ b/Pacman_refactored/Classes/Map.cs @@ -0,0 +1,17 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System.Collections.Generic; + +namespace Pacman_refactored.Classes +{ + public class Map + { + private Texture2D _texture; + + public int[,] Matrix; + public List> Teleports; + + public int CellSize = 24; + } +} diff --git a/Pacman_refactored/Classes/Pacman.cs b/Pacman_refactored/Classes/Pacman.cs new file mode 100644 index 0000000..9d702be --- /dev/null +++ b/Pacman_refactored/Classes/Pacman.cs @@ -0,0 +1,42 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Pacman_refactored.Classes.Interfaces; + +namespace Pacman_refactored.Classes +{ + public class Pacman : Entity, IMovable, IRotatable, IAnimate, IControl + { + public override Texture2D Texture { get; set; } + + public override Vector2 Position { get; set; } + public override Direction Direction { get; set; } + public override float Rotation { get; set; } + + public override int[] StartPosition { get; set; } + + public override float Speed { get; set; } + public override bool IsAlive { get; set; } + + + public override int CellSize { get; set; } + public override Rectangle SourceRect { get; set; } + public override Rectangle Boundingbox { get; set; } + + public override int TextureNumber { get; set; } + public override int TextureCount { get; set; } + + public Pacman(Texture2D texture, int[] startPosition, float speed, int cellSize) + { + Texture = texture; + StartPosition = startPosition; + Position = new Vector2(startPosition[0] * cellSize, startPosition[1] * cellSize); + Speed = speed; + CellSize = cellSize; + IsAlive = true; + TextureNumber = 0; + TextureCount = Texture.Width / cellSize; + Direction = Direction.Up; + } + } +} diff --git a/Pacman_refactored/Content/Content.mgcb b/Pacman_refactored/Content/Content.mgcb new file mode 100644 index 0000000..ddc4c36 --- /dev/null +++ b/Pacman_refactored/Content/Content.mgcb @@ -0,0 +1,15 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/platform:DesktopGL +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# + diff --git a/Pacman_refactored/Game1.cs b/Pacman_refactored/Game1.cs new file mode 100644 index 0000000..f3a4fe3 --- /dev/null +++ b/Pacman_refactored/Game1.cs @@ -0,0 +1,52 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace Pacman_refactored +{ + public class Game1 : Game + { + private GraphicsDeviceManager _graphics; + private SpriteBatch _spriteBatch; + + public Game1() + { + _graphics = new GraphicsDeviceManager(this); + Content.RootDirectory = "Content"; + IsMouseVisible = true; + } + + protected override void Initialize() + { + // TODO: Add your initialization logic here + + base.Initialize(); + } + + protected override void LoadContent() + { + _spriteBatch = new SpriteBatch(GraphicsDevice); + + // TODO: use this.Content to load your game content here + } + + protected override void Update(GameTime gameTime) + { + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) + Exit(); + + // TODO: Add your update logic here + + base.Update(gameTime); + } + + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + // TODO: Add your drawing code here + + base.Draw(gameTime); + } + } +} diff --git a/Pacman_refactored/Icon.bmp b/Pacman_refactored/Icon.bmp new file mode 100644 index 0000000..2b48165 Binary files /dev/null and b/Pacman_refactored/Icon.bmp differ diff --git a/Pacman_refactored/Icon.ico b/Pacman_refactored/Icon.ico new file mode 100644 index 0000000..7d9dec1 Binary files /dev/null and b/Pacman_refactored/Icon.ico differ diff --git a/Pacman_refactored/Pacman_refactored.csproj b/Pacman_refactored/Pacman_refactored.csproj new file mode 100644 index 0000000..d05bbcf --- /dev/null +++ b/Pacman_refactored/Pacman_refactored.csproj @@ -0,0 +1,33 @@ + + + WinExe + netcoreapp3.1 + false + false + + + app.manifest + Icon.ico + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pacman_refactored/Program.cs b/Pacman_refactored/Program.cs new file mode 100644 index 0000000..11c3b54 --- /dev/null +++ b/Pacman_refactored/Program.cs @@ -0,0 +1,14 @@ +using System; + +namespace Pacman_refactored +{ + public static class Program + { + [STAThread] + static void Main() + { + using (var game = new Game1()) + game.Run(); + } + } +} diff --git a/Pacman_refactored/app.manifest b/Pacman_refactored/app.manifest new file mode 100644 index 0000000..745b509 --- /dev/null +++ b/Pacman_refactored/app.manifest @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/pm + permonitorv2,permonitor + + + +