LevelsChecker - click to expand!
namespace GameData
{
public class LevelsChecker
{
private readonly int _sideSize;
namespace GameData
{
public class LevelsChecker
{
private readonly int _sideSize;
namespace GameData
{
public class LevelsChecker
{
private readonly int _sideSize;
class BruteForceLevelsChecker {
private final int sideSize;
BruteForceLevelsChecker(int sideSize) {
this.sideSize = sideSize;
public class BruteForceLevelsGenerator {
private static final int MIN_NODE_COUNT_INCLUDED = 4;
private static final int MAX_NODE_COUNT_EXCLUDED = 7;
private static final int SIDE_SIZE = 4; // 16 --> max 12 min 10
private static final int SIDE_WITHOUT_CORNERS_SIZE = SIDE_SIZE - 2;
class LevelsGenerator {
// MIN NODE = SIDE_SIZE * SIDE_SIZE * 0.75
// MAX NODE = SIDE_SIZE * SIDE_SIZE * 0.625
private static final int MIN_NODE_COUNT_INCLUDED = 4;
private static final int MAX_NODE_COUNT_EXCLUDED = 7;
public class ChangeOrientationButton : MonoBehaviour | |
{ | |
public void ChangeOrientation() | |
{ | |
if (Screen.orientation == ScreenOrientation.Portrait) | |
{ | |
Screen.orientation = ScreenOrientation.Landscape; | |
} | |
else | |
{ |
public static class PlayerPrefsUtils | |
{ | |
private const string Orientation = "Orientation"; | |
public static bool IsPortrait() | |
{ | |
return PlayerPrefs.GetInt(Orientation, 1) == 1; | |
} | |
public static bool HasOrientation() |
public void ChangeOrientation() | |
{ | |
if (Screen.orientation == ScreenOrientation.Portrait) | |
{ | |
Screen.orientation = ScreenOrientation.Landscape; | |
PlayerPrefsUtils.SavePortrait(false); | |
} | |
else | |
{ | |
Screen.orientation = ScreenOrientation.Portrait; |
public class OrientationSetter : MonoBehaviour | |
{ | |
private void Awake() | |
{ | |
SetupInitialOrientation(); | |
} | |
private static void SetupInitialOrientation() | |
{ | |
if (PlayerPrefsUtils.HasOrientation()) |
public class OrientationSetter : MonoBehaviour | |
{ | |
private void Awake() | |
{ | |
StartCoroutine(SetupInitialOrientation()); | |
} | |
private static IEnumerator SetupInitialOrientation() | |
{ | |
if (PlayerPrefsUtils.HasOrientation()) |