Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3596756
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:01:47+00:00 2026-05-18T20:01:47+00:00

I have fixed the problem of it not listing the data which was related

  • 0

I have fixed the problem of it not listing the data which was related to a wrong field on the spawn dictionary but still i would like to question if the way I am approaching it is ok ?

I have a few checkboxs that if true should add check the item status and include it on the list.

So not really knowing what to do, this is what I came up with:

        HashSet<int> status = new HashSet<int>();
        if (OptionsForm.filterPlayer.Checked) status.Add(0);
        if (OptionsForm.filterEnemy.Checked) status.Add(1);
        if (OptionsForm.filterSummon.Checked) status.Add(2);
        if (OptionsForm.filterNPC.Checked) status.Add(3);
        if (OptionsForm.filterObject.Checked) status.Add(4);
        if (OptionsForm.filterMonster.Checked) status.Add(5);
        if (OptionsForm.filterGatherable.Checked) status.Add(6);
        if (OptionsForm.filterUnk.Checked) status.Add(7);

        var query = from SpawnList item in spawnEntities.Values
                    where status.Contains(item.Status)
                    orderby item.Name ascending
                    select item;

But currently it is not returning me any errors or items that should have been returned.

spawnEntities is a dictionary with uint, SpawnList.

SpawnList is a simple class:

public class SpawnList
{
    public string Name { get; set; }
    public int Status { get; set; }
    // some more data not needed for the question
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:01:48+00:00Added an answer on May 18, 2026 at 8:01 pm

    it was my mistake, the status on the
    dictionary was wrong in 1 field and i
    was not getting what I wanted after
    listing all the data I noticed it heh,
    but is it ok to do it like I am doing
    ?

    To avoid such mistakes, I would use enumerations instead of ints – just define

    enum SomeStatus
    {
        Player,
        Enemy,
        <.etc.>
    }
    

    and change

    public int Status { get; set; }
    

    into

    public SomeStatus Status { get; set; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have fixed the problem of it not listing the data which was related
Now I have fixed the problem the T_ELSE parse error is not displaying anymore,
I have fixed my earlier problem , but now the loop produces 8 or
I have a problem with IE. I have a fixed div like this: #fixed
I tried searching and didn't find anything that fixed my problem. I have a
I have the following code: #include <iostream> #include Student.h <-- fixed the problem #include
Okay, so I've got a problem - and I'd love to have it fixed.
I am new to jQueryMobile. I have one problem regarding fixed headers. I have
The problem: I have a combo box that needs to fit into a fixed
EDIT: I have fixed all but two warnings now, so thank you all for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.