You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.7 KiB

namespace ET
{
[FriendClass(typeof(Unit))]
public class M2C_NotifyUpdateValleyHandler: AMHandler<M2C_NotifyUpdateValley>
{
protected override void Run(Session session, M2C_NotifyUpdateValley message)
{
if (message.Ks != null)
{
Unit unit = UnitComponent.unit;
for (int i = 0; i < message.Ks.Count; i++)
{
switch (message.Ks[i])
{
case NumericType.Food:
unit.Food = (int)message.Vs[i];
break;
case NumericType.Water:
unit.Water = (int) message.Vs[i];
break;
case NumericType.Scale:
unit.Scale = (int)message.Vs[i];
break;
case NumericType.Prosperity:
unit.Prosperity = (int) message.Vs[i];
break;
case NumericType.Season:
unit.Season = (int)message.Vs[i];
break;
case NumericType.SilverTael:
unit.SilverTael = (int) message.Vs[i];
break;
case NumericType.Time:
unit.GameTime = (int)message.Vs[i];
break;
case NumericType.GoldIngot:
unit.GoldIngot = (int) message.Vs[i];
break;
}
}
}
}
}
}