A year from now, Diablo 3 will still be played by, probably…, millions of gamers. If you are one of them, most likely you will have the following:
- Completed all level of difficulty (normal, nightmare, hell and inferno).
- Have the collection of all the characters (barbarian, demon hunter, witch doctor, monk, wizard).
- All characters have reached max level (60).
- Have tons of rare legendary items ready to be sold / traded.
- Completed cow level in all difficulty.
- Memorize most of the dungeon maps.
- (fill in the blank).
Does what you have there matters a year from now? Well, don’t get me wrong, I like playing Diablo 3 and it’s a fun game. So fun that I will most likely be playing Diablo 3 after this post.
But, I think if one spends too much time, beyond what’s ‘normal’, it’s just become useless and pointless. Too much or too little of something always have side effect. Balance is the key.
Unless you are making a good living out of auction house with real money, please ask yourself does it matter a year from now?
Sometime it’s necessary to put resource files (globalization and localization) in another project for modularization purpose.
However, in order for the resources files to be available for other project, the access modifier must be made public.
If you found the “Access Modifier” is grey-ed out, change the “Custom Tool” property in the file’s properties to “PublicResXFileCodeGenerator”
Another case is to have this build as “Embedded Resource”. This is not necessary unless you output the library files and drop them to another solution.
Type.GetMethods() method (also
Type.GetMembers() can return a certain methods / members based on a criteria by applying
BindingFlags filter to it.
You must specify either
BindingFlags.Static in order to get a return.
To me, using
BindingFlags has been frustrated. I almost think of it as you must apply all criterias that the method / member has. I am not even sure if that statement is true / not.
Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof (ICustomer)));
This approach is sort of workaround by getting all the interfaces that the Type (
t) inherits and loop thorough them.
Second approach (preferred):
Assembly.GetTypes().Where(t => (typeof(ICustomer)).IsAssignableFrom(t));
Type.IsAssignableFrom is method to determine whether the current Type (
t) can be assigned from an instance of the specified Type (
ICustomer). The specified Type doesn’t have to be an interface.
Assembly.GetTypes().Where(t => t.IsSubclassOf(Customer));
Type.IsSubclassOf method determines whether the current Type (in this case
t) is derived from a certain class (in this case