pacman/Pacman_refactored/Interfaces/IRotatable.cs
2022-07-06 18:45:56 +03:00

35 lines
871 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using Pacman_refactored.Enums;
namespace Pacman_refactored.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;
}
}
}