Exemple #1
0
        public P_BattleMap(List <TilerIsADummy.IEntity> entitylist, P_TileArray tilearray, IP_UpdateManager updater, P_Render renderer)
        {
            TheMap    = tilearray;
            MapEntity = entitylist;

            Updater  = updater;
            Renderer = renderer;
            _Render  = new PrototypeComponents.P_RenderComponent();

            this.AcceptP_Render(Renderer);
            this.AcceptUpdater(Updater);
            Active             = true;
            this.ActiveFaction = EntityFaction.Player;

            for (int i = 0; i < entitylist.Count; i++)
            {
                entitylist[i].MyMap = TheMap;
                entitylist[i].AcceptP_Render(renderer);
                entitylist[i].AcceptUpdater(updater);
            }

            foreach (EntityActor thing in entitylist)
            {
                thing.ActiveState = EntityCharacterState.Active;
            }

            for (int i = 0; i < tilearray.MyTiles.Length; i++)
            {
                tilearray.MyTiles[i].AcceptP_Render(renderer);
                tilearray.MyTiles[i].Render.OffsetBoss = this;
            }

            PlaceActorsOnMap(entitylist);
            GiveFactionActorsATurn();

            MyState = new P_BMSPlayerSelectingTile(this);
            //tilearray.AcceptUpdater(updater);
        }
Exemple #2
0
 public void Kill()
 {
     TheMap.DismissP_Render(this.Renderer);
     TheMap.Render = null;
     for (int i = 0; i < TheMap.MyTiles.Length; i++)
     {
         TheMap.MyTiles[i].DismissP_Render(this.Renderer);
         TheMap.MyTiles[i].Render = null;
         TheMap.MyTiles[i]        = null;
     }
     TheMap.MyTiles = null;
     this.DismissP_Render(this.Renderer);
     this.DismissUpdater(this.Updater);
     for (int i = 0; i < MapEntity.Count; i++)
     {
         MapEntity[i].DismissUpdater(Updater);
         MapEntity[i].DismissP_Render(this.Renderer);
         MapEntity[i] = null;
     }
     TheMap    = null;
     MapEntity = null;
     MyState   = null;
 }