protected override void DoInteract(GameObject with, GameTime gameTime) { FarmPlayer player = with as FarmPlayer; MessageBoxComponent messageComponent = player.Components.GetComponent( c => c is MessageBoxComponent) as MessageBoxComponent; messageComponent.DrawMessage(string.Format("Safkaa viela siilossa {0} yksikkoa.", owner.FeedContained), 100 * 10); IsInteracting = false; }
protected override void DoInteract(GameObject with, GameTime gameTime) { if (owner.HasFeed) { FarmPlayer player = with as FarmPlayer; if (!player.Inventory.HasItemInHands) { player.Inventory.AddToInventory(owner.GetFeed()); } } else { MessageBoxComponent interactorMessageComponent = with.Components.GetComponent( c => c is MessageBoxComponent) as MessageBoxComponent; interactorMessageComponent.DrawMessage("Siilossa ei ole safkaa!", 100 * 25); } IsInteracting = false; }