diff --git a/ProjectSeaplane/ProjectSeaplane/DirectionType.cs b/ProjectSeaplane/ProjectSeaplane/DirectionType.cs new file mode 100644 index 0000000..91e7c91 --- /dev/null +++ b/ProjectSeaplane/ProjectSeaplane/DirectionType.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectSeaplane; + +public enum DirectionType +{ + Up = 1, + Down = 2, + Left = 3, + Right = 4, +} + diff --git a/ProjectSeaplane/ProjectSeaplane/DrawingSeaplane.cs b/ProjectSeaplane/ProjectSeaplane/DrawingSeaplane.cs new file mode 100644 index 0000000..22fc7a8 --- /dev/null +++ b/ProjectSeaplane/ProjectSeaplane/DrawingSeaplane.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectSeaplane; +public class DrawingSeaplane +{ + public EntitySeaplane? EntitySeaplane {get;private set;} + + private int? _pictureWidth; + + private int? _pictureHeight; + + private int? _startPosX; + + private int? _startPosY; + + private readonly int _drawingSeaplaneWidth = 0; + + private readonly int _drawingSeaplaneHeight = 0; + public void Init (int speed, double weight, Color bodyColor, Color additionalColor) + { + EntitySeaplane = new EntitySeaplane(); + EntitySeaplane.Init(speed, weight, bodyColor, additionalColor); + _pictureHeight = null; + _pictureWidth = null; + _startPosX = null; + _startPosY = null; + } + + public bool SetPictureSize(int width, int height) + { + _pictureHeight = height; + _pictureWidth = width; + return true; + } + + public void SetPosition(int x, int y) + { + if (!_pictureHeight.HasValue || !_pictureWidth.HasValue) + { + return; + } + + _startPosY = y; + _startPosX = x; + } +} + diff --git a/ProjectSeaplane/ProjectSeaplane/EntitySeaplane.cs b/ProjectSeaplane/ProjectSeaplane/EntitySeaplane.cs new file mode 100644 index 0000000..6d95e48 --- /dev/null +++ b/ProjectSeaplane/ProjectSeaplane/EntitySeaplane.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectSeaplane; +public class EntitySeaplane +{ + public int Speed { get; set; } + public double Weight { get; set; } + public Color BodyColor { get; private set; } + public Color AdditionalColor { get; private set; } + public double Step => Speed * 100 / Weight; + public void Init(int speed, double weight, Color bodyColor, Color additionalColor) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + } +} +