Example #1
0
        public FightGroundLayer(FightObjectType myObjectType, Fighter Caster, SpellLevel CastSpell, FightCell CastCell, int MasterSpellId, int MasterSpellSpriteId, String Zone, short Duration = -1)
        {
            this.myObjectType        = myObjectType;
            this.myCell              = CastCell;
            this.Caster              = Caster;
            this.CastSpell           = CastSpell;
            this.Size                = (short)StringHelper.HashToInt(Zone[1]);
            this.Duration            = Duration;
            this.MasterSpellId       = MasterSpellId;
            this.MasterSpellSpriteId = MasterSpellSpriteId;

            //CastCell.AddObject(this);
            Fight.addLayer(this);
            Fight.RegisterFightListener(this);

            foreach (int cellId in CellZone.GetCells(this.Fight.Map, CellId, CellId, Zone))
            {
                var Cell = this.Fight.GetCell(cellId);
                if (Cell != null)
                {
                    myCells.Add(Cell);
                    Cell.AddObject(this);
                }
            }

            Show(Caster);
        }
Example #2
0
 public List <T> GetObjects <T>(FightObjectType ObjectType) where T : IFightObject
 {
     return(this.myFightObjects.OfType <T>().ToList().FindAll(x => x.ObjectType == ObjectType));
 }
Example #3
0
 public bool HasGameObject(FightObjectType ObjectType)
 {
     return(myFightObjects.Any(x => x.ObjectType == ObjectType));
 }