JoltEffect's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
4 (0.01 per day)
Joined:
06-January 13
Profile Views:
502
Last Active:
User is offline Mar 05 2013 03:20 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   JoltEffect has not set their status

Posts I've Made

  1. In Topic: Adding an item to a list if it is not already in the list

    Posted 21 Feb 2013

    Thanks for the links, gonna run off now and read those.

    I have possible found a combination, however it does'nt look clean code to me and im sure it could be done better.

    bool noLevelRequired = true;
    
    public void Update(GameTime gameTime)
            {
                noLevelRequired = false;
    
                for (int i = 0; i < levelStack.Count; i++)
                {
                    if (levelStack[i].LevelState == LEVELSTATE.PLAYING)
                    {
                        noLevelRequired = true;
                        levelStack[i].Update(gameTime);
                        Debug.WriteLine("Level Manager Update for level " + levelStack[i].LevelName);
                    }
                    else if (levelStack[i].LevelState == LEVELSTATE.CHANGE)
                    {
    
                        loadLevelName = levelStack[i].NextLevelName;
                        levelStack[i].LevelState = LEVELSTATE.FINISHED;
                    }
    
                }
                for (int i = 0; i < levelStack.Count; i++)
                {
                    if (levelStack[i].LevelName == loadLevelName && levelStack[i].LevelState == LEVELSTATE.FINISHED)
                    {
                        levelStack[i].Init();
                        noLevelRequired = true;
                    }
                }
    
                if (noLevelRequired == false)
                {
                    level = new Level(loadLevelName, this.content);
                    levelStack.Add(level);
                }
    
    
    
            }
    


    How does this look like it seems to be working?

    Cheers

    Jolt
  2. In Topic: Adding an item to a list if it is not already in the list

    Posted 21 Feb 2013

    The issue with that process is the item will exist as every item is the same "level", its only the contents of each level that is different.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

JoltEffect hasn't added any friends yet.

Comments

JoltEffect has no profile comments yet. Why not say hello?