Exemplo n.º 1
0
        void computeFOW()
        {
            var newFOW = new FogOfWarGrid(this.FOW.usize, this.FOW.vsize);

            for (int u = 0; u < newFOW.usize; u++)
            {
                for (int v = 0; v < newFOW.vsize; v++)
                {
                    if (this.FOW.GetTileState(u, v) != TileState.Undiscovered)
                    {
                        newFOW.Discover(u, v);
                    }
                }
            }

            foreach (var actor in this.Actors.CloneToList())
            {
                if (!(actor is Bullet))
                {
                    foreach (var uv in actor.GetCurrentSightUV())
                    {
                        newFOW.IncrementVis(uv.X, uv.Y);
                    }
                }
            }

            this.FOW = newFOW;
        }
Exemplo n.º 2
0
        public Faction(byte id, int usize, int vsize)
            : this()
        {
            FOW = new FogOfWarGrid(usize, vsize);
            FOW.NotifyTileDiscovered += new TileDiscovered(FOW_NotifyTileDiscovered);

            ID             = id;
            register       = new Dictionary <Faction, FactionRelationship>();
            this.Resources = new ResourceData();
        }