Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace GameBase
- {
- class EntityMgr
- {
- public void AddEntity(Entity entityToAdd)
- {
- Entity stepEntity = firstentity;
- if (firstentity != null)
- {
- while (stepEntity.nextEntity != null)
- {
- stepEntity = stepEntity.nextEntity; // stepentity blir nรคsta entity
- {
- }
- stepEntity.nextEntity = entityToAdd;
- {
- firstentity = entityToAdd; //lรคgger till en ny entity.
- }
- }
- }
- }
- private Entity firstentity;
- public EntityMgr()
- {
- firstentity = null;
- }
- public void Update(GameTime gameTime)
- {
- Entity stepEntity = this.firstentity;
- if (firstentity!= null)
- {
- while(stepEntity!=null)
- {
- stepEntity.Update(gameTime);
- stepEntity = stepEntity.nextEntity;
- }
- }
- }
- public void Draw(SpriteBatch spriteBatch)
- {
- Entity stepentity = this.firstentity;
- if (firstentity != null)
- {
- while (stepentity != null)
- {
- stepentity.Draw(spriteBatch);
- stepentity = stepentity.nextEntity;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement