public virtual Sprite GetCurrentSprite() { return(sprite.GetCurrentSprite()); }
public override ComponentReplyMessage RecieveMessage(object sender, ComponentMessageType type, params object[] list) { ComponentReplyMessage reply = base.RecieveMessage(sender, type, list); if (sender == this) //Don't listen to our own messages! { return(ComponentReplyMessage.Empty); } switch (type) { case ComponentMessageType.CheckSpriteClick: reply = new ComponentReplyMessage(ComponentMessageType.SpriteWasClicked, WasClicked((PointF)list[0]), DrawDepth); break; case ComponentMessageType.GetAABB: reply = new ComponentReplyMessage(ComponentMessageType.CurrentAABB, AABB); break; case ComponentMessageType.GetSprite: reply = new ComponentReplyMessage(ComponentMessageType.CurrentSprite, sprite.GetCurrentSprite()); break; case ComponentMessageType.SlaveAttach: SetMaster(Owner.EntityManager.GetEntity((int)list[0])); break; case ComponentMessageType.ItemUnEquipped: case ComponentMessageType.Dropped: UnsetMaster(); break; case ComponentMessageType.MoveDirection: switch ((Direction)list[0]) { case Direction.North: sprite.Direction = Direction.North; break; case Direction.South: sprite.Direction = Direction.South; break; case Direction.East: sprite.Direction = Direction.East; break; case Direction.West: sprite.Direction = Direction.West; break; case Direction.NorthEast: sprite.Direction = Direction.NorthEast; break; case Direction.NorthWest: sprite.Direction = Direction.NorthWest; break; case Direction.SouthEast: sprite.Direction = Direction.SouthEast; break; case Direction.SouthWest: sprite.Direction = Direction.SouthWest; break; } break; case ComponentMessageType.EntitySaidSomething: ChatChannel channel; if (Enum.TryParse(list[0].ToString(), true, out channel)) { string text = list[1].ToString(); if (channel == ChatChannel.Ingame || channel == ChatChannel.Player || channel == ChatChannel.Radio) { (_speechBubble ?? (_speechBubble = new SpeechBubble(Owner.Name + Owner.Uid))).SetText(text); } } break; } return(reply); }
public Sprite GetCurrentSprite() { return(sprite.GetCurrentSprite()); }