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 6870637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:42:26+00:00 2026-05-27T03:42:26+00:00

So, I’m very new to C# (about two weeks) and I’ve reached a point

  • 0

So, I’m very new to C# (about two weeks) and I’ve reached a point in my borrowed textbook about Arrays and such.

The examples where pretty clear, but the uses were less so.

If I were to, for example, make a pokemon style game… would I be right to try the following?

Use an Array named “Pokemon” with a range of 150 to handle the initial instance of each pokemon?

Use a struct with variables such as “HP” “Move1” “Move2” “Attack” etc, with values that can be adjusted by the Pokemon array when a Pokemon is needed in battle?

Or should I use an Enum to handle what I thought the Array should do?

This is just an example to help me equate these concepts into something I’d understand better, I’m not looking to rip off pokemon at all.

  • 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-27T03:42:27+00:00Added an answer on May 27, 2026 at 3:42 am

    For enums, think of them as a way to list different values with words rather than just numbers. For example:

    enum Element
    {
        Normal,
        Fire,
        Water,
        Electric,
        Grass
        //etc.
    }
    

    Then, a Pokemon class, representing a single Pokemon:

    class Pokemon
    {
        //Properties
        public string Name { get; set; }
        public Element ElementalType { get; set; }
    
        //Constructor
        public Pokemon(string name, Element type)
        {
            this.Name = name;
            this.ElementalType = type;
        }
    }
    

    Thus, you can create Pokemon objects:

    Pokemon myPokemon = new Pokemon("Pikachu",Element.Electric);
    

    The core element of C# (and object oriented programming) is modelizing your data so that it fits in objects which are portable and changeable. Meaning that you can add all sorts of other properties (I went a bit quickly with this), such as HP, Moves, etc.

    To create an array:

    Pokemon[] allMyPokemons = new Pokemon[150];
    

    Then you need to set each one:

    allMyPokemons[0] = myPokemon;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.