mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-25 16:18:56 +08:00
Point is IHashable
This commit is contained in:
parent
610ef2308f
commit
0203ffbef7
|
@ -14,6 +14,18 @@ namespace Strawberry
|
||||||
static public readonly String Root = "assets/";
|
static public readonly String Root = "assets/";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static public String GetDir(String outStr, params String[] subDirectories)
|
||||||
|
{
|
||||||
|
outStr.Append(Root);
|
||||||
|
for (int i = 0; i < subDirectories.Count; i++)
|
||||||
|
{
|
||||||
|
outStr.Append(subDirectories[i]);
|
||||||
|
if (i < subDirectories.Count - 1)
|
||||||
|
outStr.Append(Path.DirectorySeparatorChar);
|
||||||
|
}
|
||||||
|
return outStr;
|
||||||
|
}
|
||||||
|
|
||||||
static public void LoadAll()
|
static public void LoadAll()
|
||||||
{
|
{
|
||||||
Textures = new Dictionary<String, Texture>();
|
Textures = new Dictionary<String, Texture>();
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
||||||
|
|
||||||
namespace Strawberry
|
namespace Strawberry
|
||||||
{
|
{
|
||||||
public struct Point
|
public struct Point : IHashable
|
||||||
{
|
{
|
||||||
static public readonly Point Right = .(1, 0);
|
static public readonly Point Right = .(1, 0);
|
||||||
static public readonly Point Left = .(-1, 0);
|
static public readonly Point Left = .(-1, 0);
|
||||||
|
@ -104,5 +104,10 @@ namespace Strawberry
|
||||||
{
|
{
|
||||||
return .(a.X * (int)f, a.Y);
|
return .(a.X * (int)f, a.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetHashCode()
|
||||||
|
{
|
||||||
|
return X + 9973 * Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user