public GameScene(GameData data, SpriteBatch SpriteBatch) { this.SpriteBatch = SpriteBatch; this.UIManager = new UIManager(); this.Data = data; World = Data.RegionData.CreateWorld(this, SpriteBatch.GraphicsDevice); World.Maps.Add(Data.MapDatas[0].CreateMap(World)); EntityTemplate templatePlayer = World.EntityContainer.GetPlayers()[0]; Player = templatePlayer.CreateEntity(World.EntityFactory, true) as PlayerEntity; World.Player = Player; World.Maps[0].AddEntity(Player); new LivingController(Player); World.CurrentMap = Player.Map; this.SceneState = SceneState.Alive; }
public InterfaceInteraction(UI ui, SpriteBatch spriteBatch, PlayerEntity player) : base(player) { this.spriteBatch = spriteBatch; this.Ui = ui; }
public UI CreateUI(SpriteBatch spriteBatch, PlayerEntity playerEntity) { UI res = new UI(this, spriteBatch, playerEntity); res.Template = this; return res; }
public MapEntity CreateEntity(IRegionEntityFactory factory, IResourceContainer resources, bool scrollAffected) { MapEntity result = null; switch (EntityType) { case EntityType.None: result = new MapEntity(factory, scrollAffected); break; case EntityType.Building: result = new BuildingEntity(factory, scrollAffected); break; case EntityType.Player: result = new PlayerEntity(factory, scrollAffected); break; case EntityType.Npc: result = new NPCEntity(factory, scrollAffected); break; case EntityType.Door: //result = new EntityDoor(); break; } if (result != null) result.TemplateID = this.ID; return result; }
public PlayerInteraction(PlayerEntity player) { this.player = player; }
public UI(UITemplate template, SpriteBatch spriteBatch, PlayerEntity playerEntity) { this.Template = template; this.spriteBatch = spriteBatch; this.PlayerEntity = playerEntity; }