public void AddRenderMessage(RenderMessage render_message) { if (m_render_messages == null) { RenderMessage.Recycle(render_message); return; } m_render_messages.Add(render_message); }
public void Process(RenderMessage msg) { switch (msg.Type) { case RenderMessageType.StartMoving: ProcessRenderMessage_StartMoving(msg as LocomoteRenderMessage); break; case RenderMessageType.StopMoving: ProcessRenderMessage_StopMoving(msg as LocomoteRenderMessage); break; case RenderMessageType.ChangeLocomotorSpeed: ProcessRenderMessage_ChangeLocomotorSpeed(msg as ChangeLocomotorSpeedRenderMessage); break; case RenderMessageType.ChangeDirection: ProcessRenderMessage_ChangeDirection(msg as ChangeDirectionRenderMessage); break; case RenderMessageType.ChangePosition: ProcessRenderMessage_ChangePosition(msg as ChangePositionRenderMessage); break; case RenderMessageType.CreateEntity: ProcessRenderMessage_CreateEntity(msg.EntityID); break; case RenderMessageType.DestroyEntity: ProcessRenderMessage_DestroyEntity(msg.EntityID); break; case RenderMessageType.ChangeHealth: ProcessRenderMessage_ChangeHealth(msg as ChangeHealthRenderMessage); break; case RenderMessageType.Die: ProcessRenderMessage_Die(msg.EntityID); break; case RenderMessageType.Hide: ProcessRenderMessage_Hide(msg.EntityID); break; case RenderMessageType.Show: ProcessRenderMessage_Show(msg.EntityID); break; case RenderMessageType.PlayAnimation: ProcessRenderMessage_PlayAnimation(msg as PlayAnimationRenderMessage); break; case RenderMessageType.TakeDamage: ProcessRenderMessage_TakeDamage(msg as TakeDamageRenderMessage); break; default: break; } RenderMessage.Recycle(msg); }