Ejemplo n.º 1
0
		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;
		}
Ejemplo n.º 2
0
		public InterfaceInteraction(UI ui, SpriteBatch spriteBatch, PlayerEntity player) : base(player) {
			this.spriteBatch = spriteBatch;
			this.Ui = ui;
		}
Ejemplo n.º 3
0
		public UI CreateUI(SpriteBatch spriteBatch, PlayerEntity playerEntity) {
			UI res = new UI(this, spriteBatch, playerEntity);
			res.Template = this;
			return res;
		}
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
		public PlayerInteraction(PlayerEntity player) {
			this.player = player;
		}
Ejemplo n.º 6
0
		public UI(UITemplate template, SpriteBatch spriteBatch, PlayerEntity playerEntity) {
			this.Template = template;
			this.spriteBatch = spriteBatch;
			this.PlayerEntity = playerEntity;
		}