From 54aded7c1d83ead832812302ed1a287572751d71 Mon Sep 17 00:00:00 2001 From: SergoDobro Date: Fri, 16 Aug 2024 15:19:01 +0300 Subject: [PATCH] GameObjects prepared for map --- ZoFo/GameCore/GameObjects/MapObjects/MapObject.cs | 4 ++-- .../GameObjects/MapObjects/StopObjects/StopObject.cs | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ZoFo/GameCore/GameObjects/MapObjects/MapObject.cs b/ZoFo/GameCore/GameObjects/MapObjects/MapObject.cs index 1dc14cf..d3072cc 100644 --- a/ZoFo/GameCore/GameObjects/MapObjects/MapObject.cs +++ b/ZoFo/GameCore/GameObjects/MapObjects/MapObject.cs @@ -10,13 +10,13 @@ using ZoFo.GameCore.ZoFo_graphics; namespace ZoFo.GameCore.GameObjects.MapObjects { - internal class MapObject : GameObject + public class MapObject : GameObject { public virtual bool IsColliderOn { get; protected set; } = true; private Rectangle _sourceRectangle; protected override GraphicsComponent graphicsComponent => new("tiles"); - public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position) + public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position) { _sourceRectangle = sourceRectangle; graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0, (int)size.X, (int)size.Y); diff --git a/ZoFo/GameCore/GameObjects/MapObjects/StopObjects/StopObject.cs b/ZoFo/GameCore/GameObjects/MapObjects/StopObjects/StopObject.cs index e914310..1b1d957 100644 --- a/ZoFo/GameCore/GameObjects/MapObjects/StopObjects/StopObject.cs +++ b/ZoFo/GameCore/GameObjects/MapObjects/StopObjects/StopObject.cs @@ -1,13 +1,15 @@ using Microsoft.Xna.Framework; using System; +using ZoFo.GameCore.GameManagers.CollisionManager; using ZoFo.GameCore.ZoFo_graphics; namespace ZoFo.GameCore.GameObjects.MapObjects.StopObjects; -public abstract class StopObject : GameObject +public class StopObject : MapObject { - protected StopObject(Vector2 position) : base(position) + CollisionComponent collisionComponent; + + protected StopObject(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position, size, sourceRectangle) { - //TODO } }