示例#1
0
 public void ProcessEnterTile(CChar c, MTile t)
 {
     switch (t.Type)
     {
     case (ETile.Water): { this.CreateWaterParticles(c, t); } break;
     }
 }
示例#2
0
        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);
            }
        }
示例#3
0
        // 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);
        }
示例#4
0
        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
            }
        }
示例#5
0
 public void SetNW(MTile t)
 {
     this._adjacent.Add(t); this._nw = t;
 }
示例#6
0
 public void SetSW(MTile t)
 {
     this._adjacent.Add(t); this._sw = t;
 }
示例#7
0
 public void SetSE(MTile t)
 {
     this._adjacent.Add(t); this._se = t;
 }
示例#8
0
 public void SetNE(MTile t)
 {
     this._adjacent.Add(t); this._ne = t;
 }
示例#9
0
        public List <MTile> GetArcTiles(MTile target)
        {
            var logic = new HexTileLogic();

            return(this.ConvertIHexToMTile(logic.GetArcTiles(this, target)));
        }