Class ModelFactory


  • public class ModelFactory
    extends java.lang.Object
    Author:
    Andi Hotz, (c) Sahits GmbH, 2016 Created on Nov 13, 2016
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.springframework.context.ApplicationContext context  
    • Constructor Summary

      Constructors 
      Constructor Description
      ModelFactory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IShipAuction createAnonymousShipAuction​(java.time.LocalDateTime auctionDate, int startingBid, IShip ship)
      Retrieve an auction instance for a ship, that has no previous owner, e.g.
      IBuildingAuction createBuildingAuction​(java.time.LocalDateTime auctionDate, int startingBid, IPlayer owner, IBuilding building)
      Retrieve an auction instance for the building owned by owner, which will be auctioned on auctionDate starting with startingBid
      IShipAuction createShipAuction​(java.time.LocalDateTime auctionDate, int startingBid, IPlayer owner, IShip ship)
      Retrieve an auction instance for the ship owned by owner, which will be auctioned on auctionDate starting with startingBid
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • context

        @Autowired
        private org.springframework.context.ApplicationContext context
    • Constructor Detail

      • ModelFactory

        public ModelFactory()
    • Method Detail

      • createBuildingAuction

        public IBuildingAuction createBuildingAuction​(java.time.LocalDateTime auctionDate,
                                                      int startingBid,
                                                      IPlayer owner,
                                                      IBuilding building)
        Retrieve an auction instance for the building owned by owner, which will be auctioned on auctionDate starting with startingBid
        Parameters:
        auctionDate - date of the auction
        startingBid - first bid amount
        owner - of the building to be auctioned.
        building - that is auctioned.
        Returns:
        new instance of a building auction
      • createAnonymousShipAuction

        public IShipAuction createAnonymousShipAuction​(java.time.LocalDateTime auctionDate,
                                                       int startingBid,
                                                       IShip ship)
        Retrieve an auction instance for a ship, that has no previous owner, e.g. because it was captured during a blockade mission. The auction will happen on auctionDate and start with startingBid.
        Parameters:
        auctionDate - date of the auction
        startingBid - first bid amount
        ship - that is auctioned.
        Returns:
        new instance of a ship acution
      • createShipAuction

        public IShipAuction createShipAuction​(java.time.LocalDateTime auctionDate,
                                              int startingBid,
                                              IPlayer owner,
                                              IShip ship)
        Retrieve an auction instance for the ship owned by owner, which will be auctioned on auctionDate starting with startingBid
        Parameters:
        auctionDate - date of the auction
        startingBid - first bid amount
        owner - of the ship that is auctioned
        ship - that is auctioned.
        Returns:
        new instance of a ship auction