Ejemplo n.º 1
0
        public IViewController SpawnEntity(IEntityRecipee entityRecipee, Position position, bool forceAggressive = true)
        {
            GameEntity entity;

            _entityGenerator.GenerateActorFromRecipeeAndAddToContext(_context, entityRecipee, position, out entity);
            return(InitializeViewForEntity(entity));
        }
Ejemplo n.º 2
0
        private void GeneratePlayer(IOsnowaContext osnowaContext)
        {
            Position startingPlayerPosition = new Position(osnowaContext.PositionFlags.XSize / 2, osnowaContext.PositionFlags.YSize / 2);

            // context.StartingPosition;

            if (osnowaContext.PositionFlags.Get(startingPlayerPosition + Position.Up).HasFlag(PositionFlag.Walkable))
            {
                startingPlayerPosition = startingPlayerPosition + Position.Up;
            }

            if (osnowaContext.PositionFlags.Get(startingPlayerPosition + Position.Up).HasFlag(PositionFlag.Walkable))
            {
                startingPlayerPosition = startingPlayerPosition + Position.Up;
            }

            //Position position = villageWithEntrance?.Entrance ?? context.Villages.First().Square.Positions.First();
            GameEntity playerEntity;

            _entityGenerator.GenerateActorFromRecipeeAndAddToContext(_context, _gameConfig.EntityRecipees.Player,
                                                                     startingPlayerPosition, out playerEntity, true);
        }