Basically what I want is to divide a class into multiple classes. I've tried using the partial
function but it seems that I can't get it to work.
What I want to do is to make multiple classes for the 100+ Regions under case Action.Answer:
as you can see:
namespace My.Network
{
public unsafe class MsgDialog : Msg
{
public const Int16 Id = _MSG_DIALOG;
public enum Action
{
//Actions used
}
[StructLayout(LayoutKind.Sequential)]
public struct MsgInfo
{
//MsgInfo
}
public static Byte[] Create(Int32 TaskId, Int16 Param, Byte IdxTask, Action Action, String Text)
{
//act
}
public static void Process(Client Client, Byte[] Buffer)
{
try
{
if (Client == null || Buffer == null || Client.User == null)
return;
Int16 MsgLength = (Int16)((Buffer[0x01] << 8) + Buffer[0x00]);
Int16 MsgId = (Int16)((Buffer[0x03] << 8) + Buffer[0x02]);
Int32 TaskId = (Int32)((Buffer[0x07] << 24) + (Buffer[0x06] << 16) + (Buffer[0x05] << 8) + Buffer[0x04]);
Int16 Param = (Int16)((Buffer[0x09] << 8) + Buffer[0x08]);
Byte IdxTask = (Byte)Buffer[0x0A];
Action Action = (Action)Buffer[0x0B];
String Text = Program.Encoding.GetString(Buffer, 0x0E, Buffer[0x0D]);
Player Player = Client.User;
switch (Action)
{
case Action.Answer:
{
100 + Regions
}
}
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
}
}
As requested by @Enigmativity here follows an example of one of those regions:
case 945:
{
Position += ScriptHandler.SendText("Your inventory is full!", Client, ref Data, Position);
Position += ScriptHandler.SendOption(255, "I see.", Client, ref Data, Position);
Position += ScriptHandler.SendFace(102, Client, ref Data, Position);
Position += ScriptHandler.SendEnd(Client, ref Data, Position);
ScriptHandler.SendData(Client, Data, Position);
break;
}