Пример #1
0
        void HandleCreatureMoveEvent(object sender, CreatureMoveEventArgs e)
        {
            if (e.IsRunning)
            {
                return;
            }
            if (e.IsPlayer)
            {
                if (e.IsBlocked)
                {
                    TerrainType terrain = GameMap[e.CreatureDestination].Terrain;
                    SendMessage(string.Format("There is a {0} in the way.", terrain));
                }
                else
                {
                    IEnumerable <MapCoordinates> redrawLighting = e.LitAtStartOfRun != null
                                            ? e.LitAtStartOfRun.Concat(e.GameMap.Fov.CurrentlySeen)
                                            : e.GameMap.Fov.NewlySeen.Concat(e.GameMap.Fov.NewlyUnseen);

                    foreach (var newlyLit in redrawLighting)
                    {
                        DrawCell(newlyLit);
                    }
                }
            }
            DrawCell(e.PreviousCreatureLocation);
            DrawCell(e.CreatureDestination);
            if (e.IsPlayer)
            {
                EnsurePlayerIsOnScreen();
            }
        }
Пример #2
0
        private void InvokeHeroMoveEvent(Object sender, CreatureMoveEventArgs e)
        {
            var handler = HeroMoveEvent;

            handler?.Invoke(sender, e);
        }