123321
This commit is contained in:
parent
ec127f33aa
commit
b5fa935cf2
@ -21,6 +21,8 @@ namespace WarmlyShip
|
|||||||
|
|
||||||
private readonly int _drawningWarmlyShipHeight = 80;
|
private readonly int _drawningWarmlyShipHeight = 80;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void Init(int speed, double weight, Color bodyColor, Color seckondColor, bool fuelHole, bool pipes)
|
public void Init(int speed, double weight, Color bodyColor, Color seckondColor, bool fuelHole, bool pipes)
|
||||||
{
|
{
|
||||||
EntityWarmlyShip = new EntityWarmlyShip();
|
EntityWarmlyShip = new EntityWarmlyShip();
|
||||||
@ -32,13 +34,24 @@ namespace WarmlyShip
|
|||||||
}
|
}
|
||||||
public bool SetPictureSize(int width, int height)
|
public bool SetPictureSize(int width, int height)
|
||||||
{
|
{
|
||||||
|
if (width > _drawningWarmlyShipWidth && height > _drawningWarmlyShipHeight)
|
||||||
|
{
|
||||||
|
_pictureWidth = width;
|
||||||
|
_pictureHeight = height;
|
||||||
|
|
||||||
_pictureHeight = height;
|
if (_startPosX != null && _startPosY != null)
|
||||||
_pictureWidth = width;
|
{
|
||||||
|
if (_startPosX.Value + _drawningWarmlyShipWidth > _pictureWidth || _startPosY.Value + _drawningWarmlyShipHeight > _pictureHeight)
|
||||||
|
{
|
||||||
|
EntityWarmlyShip = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
public void SetPosition(int x, int y)
|
public void SetPosition(int x, int y)
|
||||||
{
|
{
|
||||||
@ -46,24 +59,15 @@ namespace WarmlyShip
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
// корректировка координат ессли не влазит
|
|
||||||
_startPosX = x;
|
_startPosX = x;
|
||||||
_startPosY = y;
|
_startPosY = y;
|
||||||
|
if (_drawningWarmlyShipHeight + _startPosY.Value > _pictureHeight || _drawningWarmlyShipWidth + _startPosX > _pictureWidth)
|
||||||
if (_pictureHeight < _drawningWarmlyShipHeight || _pictureWidth < _drawningWarmlyShipWidth)
|
|
||||||
{
|
|
||||||
EntityWarmlyShip = null;
|
|
||||||
}
|
|
||||||
else if (_pictureHeight < _drawningWarmlyShipHeight + _startPosY.Value || _pictureWidth < _drawningWarmlyShipWidth + _startPosX.Value)
|
|
||||||
{
|
{
|
||||||
_startPosX = 0;
|
_startPosX = 0;
|
||||||
_startPosY = 0;
|
_startPosY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public bool MoveTransport(DirectionType direction)
|
public bool MoveTransport(DirectionType direction)
|
||||||
{
|
{
|
||||||
@ -75,7 +79,7 @@ namespace WarmlyShip
|
|||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
case DirectionType.Left:
|
case DirectionType.Left:
|
||||||
if (_startPosY.Value - EntityWarmlyShip.Step > 0)
|
if (_startPosX.Value - EntityWarmlyShip.Step > 0)
|
||||||
{
|
{
|
||||||
_startPosX -= (int)EntityWarmlyShip.Step;
|
_startPosX -= (int)EntityWarmlyShip.Step;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// Этот код создан программой.
|
||||||
// Runtime Version:4.0.30319.42000
|
// Исполняемая версия:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
// the code is regenerated.
|
// повторной генерации кода.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -13,12 +13,12 @@ namespace WarmlyShip.Properties {
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||||
// class via a tool like ResGen or Visual Studio.
|
// с помощью такого средства, как ResGen или Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// с параметром /str или перестройте свой проект VS.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
@ -33,7 +33,7 @@ namespace WarmlyShip.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
@ -47,8 +47,8 @@ namespace WarmlyShip.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
@ -61,7 +61,7 @@ namespace WarmlyShip.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap arrowDown {
|
internal static System.Drawing.Bitmap arrowDown {
|
||||||
get {
|
get {
|
||||||
@ -71,7 +71,7 @@ namespace WarmlyShip.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap arrowLeft {
|
internal static System.Drawing.Bitmap arrowLeft {
|
||||||
get {
|
get {
|
||||||
@ -81,7 +81,7 @@ namespace WarmlyShip.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap arrowRight {
|
internal static System.Drawing.Bitmap arrowRight {
|
||||||
get {
|
get {
|
||||||
@ -91,7 +91,7 @@ namespace WarmlyShip.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap arrowUp {
|
internal static System.Drawing.Bitmap arrowUp {
|
||||||
get {
|
get {
|
||||||
|
Loading…
Reference in New Issue
Block a user