From 9fb556bc0745fab146d72d7086dabd889a93b7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B8=D0=BC=D0=B0?= Date: Wed, 22 May 2024 03:01:19 +0400 Subject: [PATCH] d --- .../MovementStrategy/MoveableTank.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ArtilleryUnit/ArtilleryUnit/MovementStrategy/MoveableTank.cs b/ArtilleryUnit/ArtilleryUnit/MovementStrategy/MoveableTank.cs index d7d6f6f..eb345e9 100644 --- a/ArtilleryUnit/ArtilleryUnit/MovementStrategy/MoveableTank.cs +++ b/ArtilleryUnit/ArtilleryUnit/MovementStrategy/MoveableTank.cs @@ -10,36 +10,36 @@ namespace ProjectArtilleryUnit.MovementStrategy /// /// Поле-объект класса DrawningArtilleryUnit или его наследника /// - private readonly DrawningArtilleryUnit? _cruiser = null; + private readonly DrawningArtilleryUnit? _artilleryUnit = null; /// /// Конструктор /// - /// Объект класса DrawningArtilleryUnit - public MoveableArtilleryUnit(DrawningArtilleryUnit cruiser) + /// Объект класса DrawningArtilleryUnit + public MoveableArtilleryUnit(DrawningArtilleryUnit artilleryUnit) { - _cruiser = cruiser; + _artilleryUnit = artilleryUnit; } public ObjectParameters? GetObjectPosition { get { - if (_cruiser == null || _cruiser.EntityArtilleryUnit == null || - !_cruiser.GetPosX.HasValue || !_cruiser.GetPosY.HasValue) + if (_artilleryUnit == null || _artilleryUnit.EntityArtilleryUnit == null || + !_artilleryUnit.GetPosX.HasValue || !_artilleryUnit.GetPosY.HasValue) { return null; } - return new ObjectParameters(_cruiser.GetPosX.Value, - _cruiser.GetPosY.Value, _cruiser.GetWidth, _cruiser.GetHeight); + return new ObjectParameters(_artilleryUnit.GetPosX.Value, + _artilleryUnit.GetPosY.Value, _artilleryUnit.GetWidth, _artilleryUnit.GetHeight); } } - public int GetStep => (int)(_cruiser?.EntityArtilleryUnit?.Step ?? 0); + public int GetStep => (int)(_artilleryUnit?.EntityArtilleryUnit?.Step ?? 0); public bool TryMoveObject(MovementDirection direction) { - if (_cruiser == null || _cruiser.EntityArtilleryUnit == null) + if (_artilleryUnit == null || _artilleryUnit.EntityArtilleryUnit == null) { return false; } - return _cruiser.MoveTransport(GetDirectionType(direction)); + return _artilleryUnit.MoveTransport(GetDirectionType(direction)); } /// /// Конвертация из MovementDirection в DirectionType