// now force a refresh of the mobs default loot template
if (isDefaultLootTemplateRefreshed == false)
- {
RefreshLootTemplate(mob.Name);
- }
MyMethod(arg3: true, arg2: 12);
dynamic dynamicDemoClassObj = Activator.CreateInstance(demoClassType);
dynamicDemoClassObj.Name = "Adil";
Assembly asmLib= Assembly.LoadFile(@"C:\temp\DemoClass\bin\Debug\DemoClass.dll");
Type demoClassType = asmLib.GetType("DemoClass.DemoClassLib");
object demoClassobj= Activator.CreateInstance(demoClassType);
PropertyInfo pInfo= demoClassType.GetProperty("Name");
pInfo.SetValue(demoClassobj, "Adil", null);
Tolakram wrote:
- Code: Select all
// now force a refresh of the mobs default loot template
if (isDefaultLootTemplateRefreshed == false)
- {
RefreshLootTemplate(mob.Name);
- }
I strongly disagree with this change. There is no reason to remove the braces and I added them for readability.
Tolakram wrote:One of the biggest gripes I had when switching from C++ to C# was the lack of default parameters. I used them heavily, probably too much, but I love them.
Graveen wrote:resharper does not like the inline braces for TCF.
There is enough here to start another religious developper war !
Tolakram wrote:lol. MUST HAVE CURLY BRACES!
My argument is, as a manager, I've seen too many middling developers screw up when braces do not clearly denote blocks. I think dre is probably more skilled than I am at coding, but think of the children!
byte value;
using(Stream inStr = File.Open("toto"))
if ((value = inStr.ReadByte()) != 0)
lock(_sync)
this.Value = value;
// Or
if (inStr.ReadByte() == 0 && inStr.ReadByte() == (int)eDummyEnum.DummyValue && inStr.ReadByte() == (int)eDummyEnum2.DummyValue2 &&
inStr.ReadByte() == 10)
Console.WriteLine("Hello");
// "inStr" can't be used after this code "inStr.Position = ??"
byte value;
using(Stream inStr = File.Open("toto"))
{
if ((value = inStr.ReadByte()) != 0)
{
lock(_sync)
this.Value = value;
}
}
// And
byte byte1 = inStr.ReadByte(); // Read bytes before condition, we aren't lost in stream after the condition
byte byte2 = inStr.ReadByte();
byte byte3 = inStr.ReadByte();
byte byte4 = inStr.ReadByte();
if (byte1 == 0 && byte2 == (int)eDummyEnum.DummyValue && byte3 == (int)eDummyEnum2.DummyValue2 &&
byte4 == 10)
{ // Add braces, we cann't see (quickly) the condition and the scope without them
Console.WriteLine("Hello");
}
// inStr.Position = 4 in all cases
Return to “%s” DOL Code Contributions
Users browsing this forum: No registered users and 1 guest