/// <summary>
        /// Spawns the players entity.
        /// </summary>
        /// <param name="session"></param>
        public void SpawnPlayerMob(IPlayerSession session)
        {
            //TODO: There's probably a much better place to do this.
            IEntity entity = _entityManager.ForceSpawnEntityAt("HumanMob", new Vector2(0, 0));

            session.AttachToEntity(entity);
        }
예제 #2
0
        public void SpawnPlayerMob(IPlayerSession s)
        {
            //Spawn the player's entity. There's probably a much better place to do this.
            IEntity a = entityManager.SpawnEntity("HumanMob");

            a.GetComponent <ITransformComponent>(ComponentFamily.Transform).TranslateTo(new Vector2f(0, 0));
            s.AttachToEntity(a);
        }
예제 #3
0
        /// <summary>
        /// Spawns the players entity.
        /// </summary>
        /// <param name="session"></param>
        public void SpawnPlayerMob(IPlayerSession session)
        {
            // TODO: There's probably a much better place to do this.
            var prototype = "HumanMob";

            if (_prototypeManager.HasIndex <EntityPrototype>("HumanMob_Content"))
            {
                prototype = "HumanMob_Content";
            }
            IEntity entity = _entityManager.ForceSpawnEntityAt(prototype, new Vector2(0, 0), 1); //TODO: Fix this

            session.AttachToEntity(entity);
        }
예제 #4
0
 public void SpawnPlayerMob(IPlayerSession s)
 {
     //Spawn the player's entity. There's probably a much better place to do this.
     Entity a = server.EntityManager.SpawnEntity("HumanMob");
     Entity human = a;
     a.GetComponent<ITransformComponent>(ComponentFamily.Transform).TranslateTo(new Vector2(0, 0));
     if (s.assignedJob != null)
     {
         foreach (
             Entity newItem in
                 s.assignedJob.SpawnEquipment.Select(def => server.EntityManager.SpawnEntity(def.ObjectType)))
         {
             newItem.GetComponent<ITransformComponent>(ComponentFamily.Transform).TranslateTo(
                 human.GetComponent<ITransformComponent>(ComponentFamily.Transform).Position);
             human.GetComponent<IEquipmentComponent>(ComponentFamily.Equipment).RaiseEquipItem(newItem);
         }
     }
     s.AttachToEntity(a);
 }
예제 #5
0
        public void SpawnPlayerMob(IPlayerSession s)
        {
            //Spawn the player's entity. There's probably a much better place to do this.
            Entity a     = server.EntityManager.SpawnEntity("HumanMob");
            Entity human = a;

            a.GetComponent <ITransformComponent>(ComponentFamily.Transform).TranslateTo(new Vector2f(0, 0));
            if (s.assignedJob != null)
            {
                foreach (
                    Entity newItem in
                    s.assignedJob.SpawnEquipment.Select(def => server.EntityManager.SpawnEntity(def.ObjectType)))
                {
                    newItem.GetComponent <ITransformComponent>(ComponentFamily.Transform).TranslateTo(
                        human.GetComponent <ITransformComponent>(ComponentFamily.Transform).Position);
                    human.GetComponent <IEquipmentComponent>(ComponentFamily.Equipment).RaiseEquipItem(newItem);
                }
            }
            s.AttachToEntity(a);
        }
예제 #6
0
        public void SpawnPlayerMob(IPlayerSession s)
        {
            //Spawn the player's entity. There's probably a much better place to do this.
            Entity a     = server.EntityManager.SpawnEntity("HumanMob");
            Entity human = a;

            a.GetComponent <ITransformComponent>(ComponentFamily.Transform).TranslateTo(new Vector2(160, 160));
            if (s.assignedJob != null)
            {
                foreach (
                    Entity newItem in
                    s.assignedJob.SpawnEquipment.Select(def => server.EntityManager.SpawnEntity(def.ObjectType)))
                {
                    newItem.GetComponent <ITransformComponent>(ComponentFamily.Transform).TranslateTo(
                        human.GetComponent <ITransformComponent>(ComponentFamily.Transform).Position);
                    //This is not neccessary once the equipment component is built.
                    human.SendMessage(this, ComponentMessageType.EquipItem, newItem);
                }
            }
            s.AttachToEntity(a);
        }
예제 #7
0
        /// <summary>
        ///     Spawns the players entity.
        /// </summary>
        /// <param name="session"></param>
        public void SpawnPlayerMob(IPlayerSession session)
        {
            var entity = _entityManager.ForceSpawnEntityAt(PlayerPrototypeName, FallbackSpawnPoint);

            session.AttachToEntity(entity);
        }
예제 #8
0
        /// <summary>
        /// Spawns the players entity.
        /// </summary>
        /// <param name="session"></param>
        public void SpawnPlayerMob(IPlayerSession session)
        {
            IEntity entity = _entityManager.ForceSpawnEntityAt(PlayerPrototypeName, new Vector2(0, 0), 1); //TODO: Fix this

            session.AttachToEntity(entity);
        }
예제 #9
0
 public void SpawnPlayerMob(IPlayerSession s)
 {
     //Spawn the player's entity. There's probably a much better place to do this.
     Entity a = server.EntityManager.SpawnEntity("HumanMob");
     Entity human = a;
     a.GetComponent<ITransformComponent>(ComponentFamily.Transform).TranslateTo(new Vector2(160, 160));
     if (s.assignedJob != null)
     {
         foreach (
             Entity newItem in
                 s.assignedJob.SpawnEquipment.Select(def => server.EntityManager.SpawnEntity(def.ObjectType)))
         {
             newItem.GetComponent<ITransformComponent>(ComponentFamily.Transform).TranslateTo(
                 human.GetComponent<ITransformComponent>(ComponentFamily.Transform).Position);
             //This is not neccessary once the equipment component is built.
             human.SendMessage(this, ComponentMessageType.EquipItem, newItem);
         }
     }
     s.AttachToEntity(a);
 }