Example #1
0
 protected override void InitControl(Entities.ISceneObject me)
 {
     this.obj = me.GetControlOfType <IHpControl>();
     if (this.obj == null)
     {
         throw new Exception("HpBarControl must be attached to object containing HpControl");
     }
 }
Example #2
0
 public static void WriteHealthControl(this NetOutgoingMessage msg, IHpControl c)
 {
     msg.WriteControl(c as Control);
     msg.Write(c.Hp);
     msg.Write(c.MaxHp);
 }
 protected override void InitControl(ISceneObject me)
 {
     hpControl = me.GetControlOfType <IHpControl>();
 }
Example #4
0
 public static void ReadHealthControl(this NetIncomingMessage msg, IHpControl c)
 {
     msg.ReadControl(c as Control);
     c.Hp    = msg.ReadInt32();
     c.MaxHp = msg.ReadInt32();
 }