public static int Build(AxialCoord a, AxialCoord b) { Debug.Assert(a.X < 100); Debug.Assert(a.Y < 100); Debug.Assert(b.X < 100); Debug.Assert(b.Y < 100); return(a.X * 1000000 + a.Y * 10000 + b.X * 100 + b.Y); }
public bool MoveMob(Mob mob, AxialCoord to) { if (mob.Coord == to) { Utils.Log(LogSeverity.Debug, nameof(MobManager), "MoveMob failed trying to move zero distance."); return(false); } Debug.Assert(mob.Coord != to, "Trying to move zero distance."); Debug.Assert(mob.Coord.Distance(to) == 1, "Trying to walk more than 1 hex"); if (mob.Ap > 0) { mob.Coord = to; mob.Ap--; return(true); } else { return(false); } }
public MapItem(AxialCoord coord, HexType hexType) { Coord = coord; HexType = hexType; }
public Mob AtCoord(AxialCoord c) { return(Mobs.FirstOrDefault(mob => Equals(mob.Coord, c))); }
public JsonAreaBuff(AreaBuff areaBuff) { Coord = areaBuff.Coord; Radius = areaBuff.Radius; Effect = new JsonBuff(areaBuff.Effect); }
public T this[AxialCoord c] { get { return(_data[c.X + Size, c.Y + Size]); } set { _data[c.X + Size, c.Y + Size] = value; } }