protected override void ParseMessage(IncomingMessage inMessage)
 {
     int numEntries = inMessage.ReadInt32();
     for (int i = 0; i < numEntries; ++i) {
         string type = inMessage.ReadString();
         switch (type) {
             case "add":
                 AnimationEntry entry = new AnimationEntry();
                 entry.animationName = inMessage.ReadString();
                 entry.animationSpeed = 1.0f;
                 entry.loop = inMessage.ReadBool();
                 if (animations.Count > 0) {
                     AnimationEntry last = animations[animations.Count - 1];
                     if (last.loop)
                         animations.RemoveAt(animations.Count - 1);
                 }
                 animations.Add(entry);
                 break;
             case "clear":
                 animations.Clear();
                 clear = true;
                 break;
             default:
                 log.WarnFormat("Invalid animation message type: {0}", type);
                 break;
         }
     }
 }
 public AnimationStateInfo QueueAnimation(AnimationEntry animEntry)
 {
     return QueueAnimation(animEntry.animationName, 0.0f, 0.0f, animEntry.animationSpeed, 1.0f, animEntry.loop);
 }