Class ShopService

  • All Implemented Interfaces:
    IShopService

    public class ShopService
    extends java.lang.Object
    implements IShopService
    The shop for buying goods at the shop.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IInternalAccess comp
      The component.
      protected java.lang.String name
      The shop name.
    • Constructor Summary

      Constructors 
      Constructor Description
      ShopService()
      Create a new shop service.
      ShopService​(java.lang.String name)
      Create a new shop service.
    • Field Detail

      • name

        protected java.lang.String name
        The shop name.
    • Constructor Detail

      • ShopService

        public ShopService()
        Create a new shop service.
      • ShopService

        public ShopService​(java.lang.String name)
        Create a new shop service.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the shop name.
        Specified by:
        getName in interface IShopService
        Returns:
        The name.
      • buyItem

        public IFuture<ItemInfo> buyItem​(java.lang.String item,
                                         double price)
        Buy an item.
        Specified by:
        buyItem in interface IShopService
        Parameters:
        item - The item.
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.