473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Files, Arrays, Struct?

[Warning: C# Newb Questions, may cause headaches and/or Migraines]

Hello all. I'm in the process of learning C# with no books, until I
can buy a book on it.

I am creating a small game while I learn it, just for my own
enjoyment. Right now I am trying to create a small editor to edit the
"Monsters". I will have 100 monster records that I want to save into
a binary file.

In VB, this was a no brainer, at least for me. I defined a struct in
a separate .bas file that has all of the mob information. I then
loaded the monster records into a series of arrays, editted the
monsters, saved the file again.

I need some direction to do this in C#. Where do I define the Struct?
Can I use a separate file to do this to keep it clean?

I'm just looking for some direction here. I am hoping to buy a book
on it soon, but atm i don't have one. Any help is greatly
appreciated. Thanks in advance.

Acidon
Nov 16 '05 #1
1 1340
Serialization and the BinaryFormatter are what you are looking for in this case.
That'll let you define your structs, create your arrays, and write them out.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Acidon Purplehaze" <ac****@comcast.net> wrote in message
news:jr********************************@4ax.com...
[Warning: C# Newb Questions, may cause headaches and/or Migraines]

Hello all. I'm in the process of learning C# with no books, until I
can buy a book on it.

I am creating a small game while I learn it, just for my own
enjoyment. Right now I am trying to create a small editor to edit the
"Monsters". I will have 100 monster records that I want to save into
a binary file.

In VB, this was a no brainer, at least for me. I defined a struct in
a separate .bas file that has all of the mob information. I then
loaded the monster records into a series of arrays, editted the
monsters, saved the file again.

I need some direction to do this in C#. Where do I define the Struct?
Can I use a separate file to do this to keep it clean?

I'm just looking for some direction here. I am hoping to buy a book
on it soon, but atm i don't have one. Any help is greatly
appreciated. Thanks in advance.

Acidon

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2057
by: Vince | last post by:
I have a very specific problem to solve but I cannot find a data structure for it. I don't know if I am posting on the good newsgroup but I cannot find a software.design group. I would like to...
18
1566
by: xarax | last post by:
Greetings, What is the general practice, usual and customary way, of including a data file into a source file? I have some large data structures defined as source similar to: ...
5
3213
by: Robert Oschler | last post by:
I am converting a Perl script over to "C" for a potential open source project. I need some open source "C" code that will give me the same functionality of a Perl Style associative array: ...
31
7700
by: aarklon | last post by:
Hi all, this is a question which i saw in a book typedef struct mall_li_header_ { int refcnt; uchar pool; uchar flag; ushort magic_no; char data;
4
5052
by: hobbes992 | last post by:
Howdy folks, I've been working on a c project, compiling using gcc, and I've reached a problem. The assignment requires creation of a two-level directory file system. No files have to be added or...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.