示例#1
0
 /**
  *
  * @param <int> $artifactPrice
  * @param <inventory> $inventoryItem
  * @return <GameProfile>
  */
 public function sellArtifact($artifactPrice, $inventoryItem)
 {
     //add gold to the gameprofile
     //remove item from inventory
     settype($inventoryItem, "object");
     settype($inventoryItem->user, "object");
     settype($inventoryItem->artifact, "object");
     $currentUserGameProfile = $_SESSION['game_profile'];
     $currentUserGameProfile->gold = $currentUserGameProfile->gold + $artifactPrice;
     $artifactDAO = new ArtifactDAO();
     $artifactDAO->sellArtifact($inventoryItem, $artifactPrice, $currentUserGameProfile);
     return $currentUserGameProfile;
 }
示例#2
0
 /**
  *
  * @param <Artifact> $artifact
  * @return <Boolean>
  */
 public function isArtifactActive($artifact)
 {
     $artifactDAO = new ArtifactDAO();
     return $artifactDAO->isArtifactActive($artifact);
 }