public void ProcessEnterTile(CChar c, MTile t) { switch (t.Type) { case (ETile.Water): { this.CreateWaterParticles(c, t); } break; } }
public MTile GetPushTile(MTile target) { var logic = new HexTileLogic(); var tile = logic.GetPushTile(this, target); if (tile != null && tile.GetCurrentOccupant() == null) { return(tile as MTile); } else { return(null); } }
// TODO: Move particle creation to load from .xml files private void CreateWaterParticles(CChar c, MTile t) { var controller = new ParticleController(); var path = StringUtil.PathBuilder( CombatGUIParams.EFFECTS_PATH, "Water", CombatGUIParams.PARTICLES_EXTENSION); var particles = controller.CreateParticle(path); if (particles != null) { controller.AttachParticle(t.Controller.Handle, particles); } var script = particles.AddComponent <SDestroyByLifetime>(); script.Init(particles, 5f); }
public int GetTravelCost(MTile tile) { var adjacent = this.GetAdjacent().Find(x => x.Equals(tile)); if (adjacent != null) { double cost = tile.GetCost(); int heightDiff = Math.Abs(this._height - tile.GetHeight()); if (heightDiff > 0) { cost *= (heightDiff + 0.5); } return((int)Math.Ceiling(cost)); } else { return(int.MaxValue); // Sentinel value } }
public void SetNW(MTile t) { this._adjacent.Add(t); this._nw = t; }
public void SetSW(MTile t) { this._adjacent.Add(t); this._sw = t; }
public void SetSE(MTile t) { this._adjacent.Add(t); this._se = t; }
public void SetNE(MTile t) { this._adjacent.Add(t); this._ne = t; }
public List <MTile> GetArcTiles(MTile target) { var logic = new HexTileLogic(); return(this.ConvertIHexToMTile(logic.GetArcTiles(this, target))); }