Jump to content
  • Advertisement

savagemonitor

Member
  • Content Count

    56
  • Joined

  • Last visited

Community Reputation

100 Neutral

About savagemonitor

  • Rank
    Member
  1. savagemonitor

    [.net] Enable/Disable USB port

    There is no easy way to enable/disable hardware using C# that I know of. I remember because I looked up how to disable the NIC using C# and it required a bunch of complex things to be done. Since I was merely costing out how much it would be to code such a thing, I told my boss that it wasn't worth it. The registry key solution is best if that's what you're trying to do. Otherwise you might be better off using C++/CLI.
  2. While I realise that you can do this, you really shouldn't. Such a thing would be a nightmare for another program to read. Rather, give it a name that describes what the image is supposed to be. If you must keep things simple, then use a term that is the equivolent ie Picture instead of Image. Granted, that's not much better, but I'm just trying to work within the example.
  3. I'd store it in a hashtable first off. That would make it easier to find things in your program when you wanted them. I think the two methods you want to use are the correct methods though.
  4. savagemonitor

    Button events in C#

    There should be an event in the button class that you can attach to. You would do it like this: button.ClickEvent += new EventHandler(buttonListener); You would do that when the form is initialized. Here's the wikipedia entry on the event handling differences between Java and C#: Quote:Event handling Java requires the programmer to implement the observer pattern manually, though it provides some syntactic sugar in form of anonymous inner classes, which allow one to define the body of the class and create an instance of it in a single point in the code. This is typically used to create observers. C# provides support for event-driven programming at the language level, including delegate types. These are type-safe references to methods and can be combined to allow multicasting. To support them there is a special syntax to define events in classes and operators to register, unregister or combine event handlers. Delegates support covariance and contravariance, and can be created as anonymous methods with full-featured closure semantics. Closures have also been proposed as a new feature for Java SE 7.[2] Like delegates in C#, such closures would have full access to all local variables in scope, not just read-only access to those marked final (as with anonymous inner classes).
  5. savagemonitor

    C# and Events

    Every solution that I can think of seems bad and convoluted. The easiest thing that I could think of would be to remove the handlers while changing the text programatically then add the handlers back when the changes are done. That way you'd never handle the event when you didn't want to.
  6. savagemonitor

    beginner needs help

    Quote:do i need a graphics engine like OGER (open sorce) to do anything?. It depends on what you want to do. However, since you're a beginner, your first projects will likely be so simple that you won't need a graphics engine. Eventually, if you want to write something like an FPS, then you'll need to either create your own graphics engine or utilize one like OGER. Quote:or i can work with the D3d library with out it You can work with the D3D library without it. If you're going to use C# to program your games, you should use XNA. It's basically a wrapper for all the DirectX stuff that you need and can be used across Windows and Xbox. Note that XNA is a framework like DirectX and not a graphics engine. As for your last question, someone with more knowledge of graphics engines would have a better answer but I here's my idea of a graphics engine: It's an abstraction layer between your game assets (textures, models, etc) that defines how the underlying graphics framework draws those assets to the screen.
  7. savagemonitor

    [C#]Internet Stuff

    This depends on the website and what you have access to. In the case of ESPN, you could go with WebRequest classes and parse the output you get back. If the web site exposes some sort of web service, you can point Visual Studio at it and then call the functions on the service as if they were an included library. If given a choice, go with the web service way of doing things, since Visual Studio will give you everything you need. I don't know how to access specific items within a web page.
  8. Disclaimer: I think this is the appropriate place for this thread, but please feel free to move it to the appropriate place. Now, on to the subject. I've been having a discussion on C# with a co-worker for some time now. He likes C/C++ and thinks that C# is pretty much a proprietary Microsoft tool to make everyone conform to their way of programming. I've disproven this where I could by pointing out that C# has an ISO standard and that the Mono project is attempting to create an Open Source VM according to this standard. The one claim that I don't have an answer for is this: "C# is basically designed to work with Visual Studio. In Mono it's a completely different beast due to the fact that you don't have Intellisense or any of the other Visual Studio features that C# pretty much requires." Is this a dumb argument? I mean, the .NET framework and Mono are both implementing something based off the same standard so they should be the same (barring the stuff that is proprietary to Microsoft). At the same time, C# benefits from the features of Visual Studio (like Intellisense) just like any other programming language would. Shouldn't it always be harder to program in a plain text editor than in Visual Studio due to the differences in features, regardless of the language?
  9. savagemonitor

    Which Complier?

    I don't know how easy this is to do with VS 2008 C++ projects, but in C# projects you can set the program type to a Windows Forms type and the output will be sent to the VS console instead of the standard console. I find this to be more practical than using artifical pauses (like sleep or input) since I don't end up writing code that I'll have to delete later. Though ctrl+F5 seems like the best solution.
  10. [source=C_Sharp] if (m_tbProgress.InvokeRequired) { SetTextCallback del = new SetTextCallback(AddMsgLine); BeginInvoke(del, new Object[] { sLine + Crlf + Crlf }); } else ...//method body if called within its own thread That's what was required in my senior project to allow a thread to make changes to a text box. Well, there is more as you need to set up a delegate to handle the invoke, but that's the way that Microsoft tells you to handle it.
  11. savagemonitor

    [.net] C# safe pointers

    Could you post some code to show us what you're doing. The class with the method you're implementing would be the best. It sounds like the object is being cloned when you don't want it to be, but it's hard to tell without the code. Also, using the ref keyword is unnecessary when dealing with objects as objects are passed by reference by default.
  12. savagemonitor

    Advice on Writing A Simulation

    Sorry about that. By resource I mean a book, tutorial, website. Basically anything that talks about the ideas behind a simulator or a "tycoon" style game.
  13. Alright, so I've been trying to do some game programming stuff and I've gotten a little fed up with 2D Platformers and 3D shooters (about the only thing I can really expect to do myself). So I thought back to when I wanted to start writing and the advice I got then was "do what you know". Well, most of my life has revolved around car dealerships as that's the family business. So I thought I'd try to create a simulation of a car dealership in the style of the Tycoon games. What I'm wondering though, where's a good place to start? I've had some experience setting up simulations (my senior project was writing the user interface for a fire department simulator) and I'm planning on writing this in C#. However, every search that has the words "computer", "simulation", or "write" comes up with a bunch of stuff. None of which is useful for what I want. So I thought I'd poke around here and see what you guys would recommend. I'd like a free resource if at all possible. I'm planning on working in C# but the recommended resource does not have to be in that language.
  14. savagemonitor

    My math scores...and getting into college *gulp*

    Truthfully, the college admissions people are only going to look at your ACT or SAT scores if you don't meet their minimum GPA requirements for admission. Well, unless you're applying to a particularly prestigious school but let's face it, MIT isn't going to take you without a 4.0 GPA and pretty much perfect scores anyways. Any state school should take you regardless of what your GPA or ACT scores are anyways. Since you're going to a state college, I feel that I should point out that a good GPA at an accredited school with a solid portfolio is going to work in your favor. Also, internships really, really help. I'm kicking myself because I'm absolutely certain that I'd be working in a software company right now if I'd done an internship.
  15. savagemonitor

    C# poker game problem

    Making the deck static could work, however I see no reason why all the players would share a deck. Make a dealer class, or use your deck as a dealer class, and use that for deck management.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!