示例#1
0
  TabInit::TabInit( XtalOptDialog *parent, XtalOpt *p ) :
    AbstractTab(parent, p)
  {
    ui.setupUi(m_tab_widget);

    // composition connections
    connect(ui.edit_composition, SIGNAL(textChanged(QString)),
            this, SLOT(getComposition(QString)));
    connect(ui.edit_composition, SIGNAL(editingFinished()),
            this, SLOT(updateComposition()));

    // unit cell dimension connections
    connect(ui.spin_a_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_b_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_c_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_alpha_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_beta_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_gamma_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_vol_min, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_a_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_b_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_c_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_alpha_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_beta_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_gamma_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_vol_max, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.spin_fixedVolume, SIGNAL(editingFinished()),
            this, SLOT(updateDimensions()));
    connect(ui.cb_fixedVolume, SIGNAL(toggled(bool)),
            this, SLOT(updateDimensions()));
    connect(ui.spin_scaleFactor, SIGNAL(valueChanged(double)),
            this, SLOT(updateDimensions()));
    connect(ui.spin_minRadius, SIGNAL(valueChanged(double)),
            this, SLOT(updateDimensions()));
    connect(ui.cb_interatomicDistanceLimit, SIGNAL(toggled(bool)),
            this, SLOT(updateDimensions()));

    QHeaderView *horizontal = ui.table_comp->horizontalHeader();
    horizontal->setResizeMode(QHeaderView::ResizeToContents);

    initialize();
  }
	void RugbyManAttack::Attack2()
	{
		int centerX = (this->getComposition()->getX() + (this->getComposition()->getWidth() / 2));
		int centerY = (this->getComposition()->getY() + (this->getComposition()->getHeight() / 2));
		GameComponents::SpriteComponent *sprite = reinterpret_cast<GameComponents::SpriteComponent*>(getComposition()->getComponent(GameComponents::SPRITE));

		glm::vec2 direction = glm::vec2(100.0, 100.0);
		if (sprite->revertX) direction = glm::vec2((-60 + centerX) - centerX, (-40 + centerY) - centerY);
		else direction = glm::vec2((60 + centerX) - centerX, (-40 + centerY) - centerY);

		createProjectile(getComposition(), GameObjects::DROP, 1.0f, glm::normalize(direction), "./assets/sprite/rugby_ball.png");
		this->composition->sendMessage(new GameMessage::Message(GameMessage::BASEBALL_SHOOT));
	}
示例#3
0
static t_list		*displayProduct(t_list *list, t_product *product)
{
  char			tmp[1024];
  t_declinaison		*current;
  t_list		*declinaisons;
  t_list		*start;
  size_t		 count;

  list = addToList(list, "<span class=\"productPage\">");
  
  *tmp = '\0';
  snprintf(tmp, 1024, "<a href=\"./produit?id=%s\"><img src=\"%s\"/></a>",
  	   id,  "images/no-image.jpg");
  list = addToList(list, strdup(tmp));

  *tmp = '\0';
  snprintf(tmp, 1024, "<h3>%s</h3>",
  	   product->ProduitNom);
  list = addToList(list, strdup(tmp));

  // FORM
  list = addToList(list, strdup("<form method='post' action=\"#\">\n"));

  // hidden values
  //	id (ProduitReference)
  *tmp = '\0';
  if (id)
    {
      snprintf(tmp, 1024, "<input type='hidden' value=\"%s\" name=\"hiddenId\"/>\n",
	       id);
      list = addToList(list, strdup(tmp));
    }

  // Displaying product description
  *tmp = '\0';
  if (strstr(product->ProduitDescription, "<p></p>") == product->ProduitDescription)
    snprintf(tmp, 1024, "<p>Pas de description disponible.</p>\n",
	     product->ProduitDescription);
  else
    snprintf(tmp, 1024, "%s",
	     product->ProduitDescription);
  list = addToList(list, strdup(tmp));

  if ((declinaisons = product->declinaisons))
    {
      list = addToList(list, "<select id=\"colorSelect\" name=\"colorSelect\">\n");
      start = declinaisons;

      //  Displaying options
      while (declinaisons && declinaisons->content)
	{
	  current = declinaisons->content;
	  *tmp = '\0';
	  if (atoi(current->DeclinaisonStock) > 0)
	    {
	      snprintf(tmp, 1024, "<option name=\"declinaison\" onclick=\"setSelectedOption(this);\" "\
		       "value=\"%s\">%s - (%s, %s)</option>\n",
		       current->DeclinaisonReference, current->Nom,
		       current->Attribut, current->Attribut2);
	    }
	  else
	    {
	      snprintf(tmp, 1024, "<option class=\"disabled\"  onclick=\"setSelectedOption(this);\" "\
		       "value=\"%s\">%s - Stock épuisé</option>\n",
		       current->DeclinaisonReference, current->Nom);
	    }
	  list = addToList(list, strdup(tmp));
	  declinaisons = declinaisons->next;
	}
      list = addToList(list, "</select>\n");
      
      count = 0;
      declinaisons = start;
      // displaying color buttons for options
      while (declinaisons && declinaisons->content)
	{
	  current = declinaisons->content;
	  *tmp = '\0';
	  if (atoi(current->DeclinaisonStock) > 0)
	    {
	      if (count == 0 /* or selected */)
		snprintf(tmp, 1024, "<input type=\"button\" "\
			 "name=\"buttonColor%d\" "		     \
			 "onclick=\"setSelected(this);\" "\
			 "class=\"colorSquare\" value=\"&#9899;\" style=\"background-color:%s;\"/>\n",
			 count, current->CouleurPrimaire);
	      else
		snprintf(tmp, 1024, "<input type=\"button\" "\
			 "name=\"buttonColor%d\" "		     \
			 "onclick=\"setSelected(this);\" "\
			 "class=\"colorSquare\" value=\"&#9898;\" style=\"background-color:%s;\"/>\n",
			 count, current->CouleurPrimaire);
	      count += 1;
	    }
	  else
	    {
	      snprintf(tmp, 1024, "<input type=\"button\" "\
			 "name=\"buttonColor%d\" "		     \
		       "onclick=\"setSelected(this);\" "\
		       "class=\"colorSquare\" value=\"&#9747;\" style=\"background-color:%s;\"/>\n",
		       count, current->CouleurPrimaire);
	    }
	  list = addToList(list, strdup(tmp));
	  declinaisons = declinaisons->next;
	}

      /* // hidden values */
      /* //	id (ProduitReference) */
      /* *tmp = '\0'; */
      /* snprintf(tmp, 1024, "<input type='hidden' value=\"%s\" name=\"hiddenId\"/>\n"\ */
      /* 	       "<input type=\"hidden\" value=\"%s\" name=\"hiddenReference\" id=\"hiddenDeclinaison\"/>\n"\ */
      /* 	       "<input type=\"hidden\" value=\"%s\" name=\"hiddenAmount\" id=\"hiddenAmount\"/>\n", */
      /* 	       id, "", ""); */
      /* list = addToList(list, strdup(tmp)); */
      declinaisons = start;
    }

  list = getComposition(list, product);


      

  // Quantité
  *tmp = '\0';
  snprintf(tmp, 1024, "<br/><br/><label for='amount'>Quantité : <br/></label>\n" \
	   "<input type='number' name='hiddenAmount' value='1' onchange=\"updateAmount(this.value)\"/>"\
"<br/><br/>\n");
  list = addToList(list, strdup(tmp));
  

  // Prix
  //	javacript price array generation
  list = addToList(list, "\n<script type=\"text/javascript\">\n");
  list = addToList(list, "//This portion of code is being generated\n");
  if (declinaisons)
    {
      declinaisons = start;
      count = 0;
      list = addToList(list, "var prices = new Array();\n");
      list = addToList(list, "var pricesHT = new Array();\n");
      list = addToList(list, "var references = new Array();\n");
      while (declinaisons && declinaisons->content)
	{
	  char		buffer[4096];

	  current = declinaisons->content;
	  *buffer = '\0';
	  snprintf(buffer, 4096, "prices[%d] = parseFloat(\"%s\");\n"\
		   "pricesHT[%d] = parseFloat(\"%s\");\n"\
		   "references[%d] = \"%s\";\n",
	  	   count, toFloat(current->DeclinaisonPrixTTC),
		   count, toFloat(current->DeclinaisonPrixHT),
		   count, current->DeclinaisonReference);
	  /* snprintf(tmp, 1024, "prices[%d] = \"%d\";\npricesHT[%d] = \"%d\";\n", */
	  /* 	   count, count, count, count * 2); */
	  count += 1;
	  list = addToList(list, strdup(buffer));
	  declinaisons = declinaisons->next;
	}
    }
  else
    {
      list = addToList(list, "var price = 0.0;\n");
      list = addToList(list, "var priceHT = 0.0;\n");
      
	  char		buffer[4096];

	  *buffer = '\0';

	  snprintf(buffer, 4096, "price = parseFloat(\"%s\");\n"\
		   "priceHT = parseFloat(\"%s\");\n",
		   toFloat(product->ProduitPrixTTC),
		   toFloat(product->ProduitPrixHT));
	  list = addToList(list, strdup(buffer));
    }
  list = addToList(list, "</script>\n");


  //	ttc
  *tmp = '\0';
  if (!declinaisons)
    snprintf(tmp, 1024, "<b class=\"price\"><span id='priceSpan'>%s</span>&#x20AC;</b> TTC<br/> " \
	     "(<span id='priceSpanHT'>%s</span>&#x20AC; HT)<br/>\n",
	     product->ProduitPrixTTC, product->ProduitPrixHT);
  else
    {
      declinaisons = start;
      if (current = declinaisons->content)
	snprintf(tmp, 1024, "<b class=\"price\"><span id='priceSpan'>%s</span>&#x20AC;</b> TTC <br/>"\
		 "(<span id='priceSpanHT'>%s</span>&#x20AC; HT)<br/>\n",
		 current->DeclinaisonPrixTTC,  current->DeclinaisonPrixHT);
    }
  list = addToList(list, strdup(tmp));



  list = addToList(list,
		   "<input type='image' name='cartButton' src='images/addToCart.png' "\
		   "class='cart' alt='ajouter au panier'/>");
  list = addToList(list,
		   "<input type='submit' class='cart' value=\"Ajouter au panier\"/>\n");

  list = addToList(list, "</form>\n");
  list = addToList(list, "</span>\n");
  return list;
}
示例#4
0
void LLViewerRegion::unpackRegionHandshake()
{
	LLMessageSystem *msg = gMessageSystem;

	U32 region_flags;
	U8 sim_access;
	std::string sim_name;
	LLUUID sim_owner;
	BOOL is_estate_manager;
	F32 water_height;
	F32 billable_factor;
	LLUUID cache_id;

	msg->getU32		("RegionInfo", "RegionFlags", region_flags);
	msg->getU8		("RegionInfo", "SimAccess", sim_access);
	msg->getString	("RegionInfo", "SimName", sim_name);
	msg->getUUID	("RegionInfo", "SimOwner", sim_owner);
	msg->getBOOL	("RegionInfo", "IsEstateManager", is_estate_manager);
	msg->getF32		("RegionInfo", "WaterHeight", water_height);
	msg->getF32		("RegionInfo", "BillableFactor", billable_factor);
	msg->getUUID	("RegionInfo", "CacheID", cache_id );

#if 0
	setRegionFlags(region_flags);
	setSimAccess(sim_access);
	setOwner(sim_owner);
	setIsEstateManager(is_estate_manager);
	setWaterHeight(water_height);
	setBillableFactor(billable_factor);
	setCacheID(cache_id);
#endif

	setRegionNameAndZone(sim_name);

	LLUUID region_id;
	msg->getUUID("RegionInfo2", "RegionID", region_id);
//	setRegionID(region_id);

#if 0
	LLVLComposition *compp = getComposition();
	if (compp)
	{
		LLUUID tmp_id;

		msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id);
		compp->setDetailTextureID(0, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail1", tmp_id);
		compp->setDetailTextureID(1, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail2", tmp_id);
		compp->setDetailTextureID(2, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id);
		compp->setDetailTextureID(3, tmp_id);

		F32 tmp_f32;
		msg->getF32("RegionInfo", "TerrainStartHeight00", tmp_f32);
		compp->setStartHeight(0, tmp_f32);
		msg->getF32("RegionInfo", "TerrainStartHeight01", tmp_f32);
		compp->setStartHeight(1, tmp_f32);
		msg->getF32("RegionInfo", "TerrainStartHeight10", tmp_f32);
		compp->setStartHeight(2, tmp_f32);
		msg->getF32("RegionInfo", "TerrainStartHeight11", tmp_f32);
		compp->setStartHeight(3, tmp_f32);

		msg->getF32("RegionInfo", "TerrainHeightRange00", tmp_f32);
		compp->setHeightRange(0, tmp_f32);
		msg->getF32("RegionInfo", "TerrainHeightRange01", tmp_f32);
		compp->setHeightRange(1, tmp_f32);
		msg->getF32("RegionInfo", "TerrainHeightRange10", tmp_f32);
		compp->setHeightRange(2, tmp_f32);
		msg->getF32("RegionInfo", "TerrainHeightRange11", tmp_f32);
		compp->setHeightRange(3, tmp_f32);

		// If this is an UPDATE (params already ready, we need to regenerate
		// all of our terrain stuff, by
		if (compp->getParamsReady())
		{
			//getLand().dirtyAllPatches();
		}
		else
		{
			compp->setParamsReady();
		}
	}
#endif

	// Now that we have the name, we can load the cache file
	// off disk.
	//loadCache();

	// After loading cache, signal that simulator can start
	// sending data.
	// TODO: Send all upstream viewer->sim handshake info here.
	LLHost host = msg->getSender();
	msg->newMessageFast( _PREHASH_RegionHandshakeReply );
	msg->nextBlockFast(_PREHASH_AgentData);
	msg->addUUIDFast(_PREHASH_AgentID, LLC::ManagerImpl::GetInstance()->GetAgentId());
	msg->addUUIDFast(_PREHASH_SessionID, LLC::ManagerImpl::GetInstance()->GetSessionId());
	msg->nextBlockFast(_PREHASH_RegionInfo);
	msg->addU32Fast(_PREHASH_Flags, 0x0 );
	msg->sendReliable(host);
}
示例#5
0
F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const
{
	if (x >= 256)
	{
		if (y >= 256)
		{
			LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f);
			LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
			if (regionp)
			{
				// OK, we need to do some hackery here - different simulators no longer use
				// the same composition values, necessarily.
				// If we're attempting to blend, then we want to make the fractional part of
				// this region match the fractional of the adjacent.  For now, just minimize
				// the delta.
				F32 our_comp = getComposition()->getValueScaled(255, 255);
				F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, y - 256.f);
				while (llabs(our_comp - adj_comp) >= 1.f)
				{
					if (our_comp > adj_comp)
					{
						adj_comp += 1.f;
					}
					else
					{
						adj_comp -= 1.f;
					}
				}
				return adj_comp;
			}
		}
		else
		{
			LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f);
			LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
			if (regionp)
			{
				// OK, we need to do some hackery here - different simulators no longer use
				// the same composition values, necessarily.
				// If we're attempting to blend, then we want to make the fractional part of
				// this region match the fractional of the adjacent.  For now, just minimize
				// the delta.
				F32 our_comp = getComposition()->getValueScaled(255.f, (F32)y);
				F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, (F32)y);
				while (llabs(our_comp - adj_comp) >= 1.f)
				{
					if (our_comp > adj_comp)
					{
						adj_comp += 1.f;
					}
					else
					{
						adj_comp -= 1.f;
					}
				}
				return adj_comp;
			}
		}
	}
	else if (y >= 256)
	{
		LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f);
		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
		if (regionp)
		{
			// OK, we need to do some hackery here - different simulators no longer use
			// the same composition values, necessarily.
			// If we're attempting to blend, then we want to make the fractional part of
			// this region match the fractional of the adjacent.  For now, just minimize
			// the delta.
			F32 our_comp = getComposition()->getValueScaled((F32)x, 255.f);
			F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - 256.f);
			while (llabs(our_comp - adj_comp) >= 1.f)
			{
				if (our_comp > adj_comp)
				{
					adj_comp += 1.f;
				}
				else
				{
					adj_comp -= 1.f;
				}
			}
			return adj_comp;
		}
	}

	return getComposition()->getValueScaled((F32)x, (F32)y);
}
示例#6
0
void LLViewerRegion::unpackRegionHandshake()
{
	LLMessageSystem *msg = gMessageSystem;

	U32 region_flags;
	U8 sim_access;
	std::string sim_name;
	LLUUID sim_owner;
	BOOL is_estate_manager;
	F32 water_height;
	F32 billable_factor;
	LLUUID cache_id;

	msg->getU32		("RegionInfo", "RegionFlags", region_flags);
	msg->getU8		("RegionInfo", "SimAccess", sim_access);
	msg->getString	("RegionInfo", "SimName", sim_name);
	msg->getUUID	("RegionInfo", "SimOwner", sim_owner);
	msg->getBOOL	("RegionInfo", "IsEstateManager", is_estate_manager);
	msg->getF32		("RegionInfo", "WaterHeight", water_height);
	msg->getF32		("RegionInfo", "BillableFactor", billable_factor);
	msg->getUUID	("RegionInfo", "CacheID", cache_id );

	setRegionFlags(region_flags);
	setSimAccess(sim_access);
	setRegionNameAndZone(sim_name);
	setOwner(sim_owner);
	setIsEstateManager(is_estate_manager);
	setWaterHeight(water_height);
	setBillableFactor(billable_factor);
	setCacheID(cache_id);

	LLUUID region_id;
	msg->getUUID("RegionInfo2", "RegionID", region_id);
	setRegionID(region_id);
	
	// Retrieve the CR-53 (Homestead/Land SKU) information
	S32 classID = 0;
	S32 cpuRatio = 0;
	std::string coloName;
	std::string productSKU;
	std::string productName;

	// the only reasonable way to decide if we actually have any data is to
	// check to see if any of these fields have positive sizes
	if (msg->getSize("RegionInfo3", "ColoName") > 0 ||
	    msg->getSize("RegionInfo3", "ProductSKU") > 0 ||
	    msg->getSize("RegionInfo3", "ProductName") > 0)
	{
		msg->getS32     ("RegionInfo3", "CPUClassID",  classID);
		msg->getS32     ("RegionInfo3", "CPURatio",    cpuRatio);
		msg->getString  ("RegionInfo3", "ColoName",    coloName);
		msg->getString  ("RegionInfo3", "ProductSKU",  productSKU);
		msg->getString  ("RegionInfo3", "ProductName", productName);
		
		mClassID = classID;
		mCPURatio = cpuRatio;
		mColoName = coloName;
		mProductSKU = productSKU;
		mProductName = productName;
	}

	LLVLComposition *compp = getComposition();
	if (compp)
	{
		LLUUID tmp_id;

		msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id);
		compp->setDetailTextureID(0, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail1", tmp_id);
		compp->setDetailTextureID(1, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail2", tmp_id);
		compp->setDetailTextureID(2, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id);
		compp->setDetailTextureID(3, tmp_id);

		F32 tmp_f32;
		msg->getF32("RegionInfo", "TerrainStartHeight00", tmp_f32);
		compp->setStartHeight(0, tmp_f32);
		msg->getF32("RegionInfo", "TerrainStartHeight01", tmp_f32);
		compp->setStartHeight(1, tmp_f32);
		msg->getF32("RegionInfo", "TerrainStartHeight10", tmp_f32);
		compp->setStartHeight(2, tmp_f32);
		msg->getF32("RegionInfo", "TerrainStartHeight11", tmp_f32);
		compp->setStartHeight(3, tmp_f32);

		msg->getF32("RegionInfo", "TerrainHeightRange00", tmp_f32);
		compp->setHeightRange(0, tmp_f32);
		msg->getF32("RegionInfo", "TerrainHeightRange01", tmp_f32);
		compp->setHeightRange(1, tmp_f32);
		msg->getF32("RegionInfo", "TerrainHeightRange10", tmp_f32);
		compp->setHeightRange(2, tmp_f32);
		msg->getF32("RegionInfo", "TerrainHeightRange11", tmp_f32);
		compp->setHeightRange(3, tmp_f32);

		// If this is an UPDATE (params already ready, we need to regenerate
		// all of our terrain stuff, by
		if (compp->getParamsReady())
		{
			getLand().dirtyAllPatches();
		}
		else
		{
			compp->setParamsReady();
		}
	}


	// Now that we have the name, we can load the cache file
	// off disk.
	loadObjectCache();

	// After loading cache, signal that simulator can start
	// sending data.
	// TODO: Send all upstream viewer->sim handshake info here.
	LLHost host = msg->getSender();
	msg->newMessage("RegionHandshakeReply");
	msg->nextBlock("AgentData");
	msg->addUUID("AgentID", gAgent.getID());
	msg->addUUID("SessionID", gAgent.getSessionID());
	msg->nextBlock("RegionInfo");
	msg->addU32("Flags", 0x0 );
	msg->sendReliable(host);
}
	void RugbyManAttack::Attack3()
	{
		GameComponents::SpriteComponent *sprite = reinterpret_cast<GameComponents::SpriteComponent*>(getComposition()->getComponent(GameComponents::SPRITE));
		if (sprite->revertX)
			this->composition->sendMessage(new GameMessage::Message(GameMessage::LEFT_DASH));
		else
			this->composition->sendMessage(new GameMessage::Message(GameMessage::RIGHT_DASH));
		this->composition->setType(GameObjects::PLAYER_ATTACK);
		this->composition->setPower(36);
		GameComponents::TimerComponent *timer = reinterpret_cast<GameComponents::TimerComponent*>(getComposition()->getComponent(GameComponents::MECHANIC));
		if (!timer)
			timer = new GameComponents::TimerComponent(this->composition);
		timer->Init();
		timer->setTimerType(GameObjects::DASH);
		timer->setTime(350);
		timer->startTimer();
	}
	void BaseballAttack::Attack3Released()
	{
		GameComponents::TimerComponent *timer = reinterpret_cast<GameComponents::TimerComponent*>(getComposition()->getComponent(GameComponents::MECHANIC));
		if (!timer)
			return;
		timer->stopTimer();
		this->composition->setInvicible(false);
		this->composition->setType(GameObjects::PLAYER);
		this->composition->sendMessage(new GameMessage::Message(GameMessage::STOP_BLOCK));
		isAtt3 = false;
	}
	void BaseballAttack::Attack3()
	{
		if (isAtt3)
			return;
		if (this->composition->getInvicible()) return;
		GameComponents::TimerComponent *timer = reinterpret_cast<GameComponents::TimerComponent*>(getComposition()->getComponent(GameComponents::MECHANIC));
		if (!timer) timer = new GameComponents::TimerComponent(this->composition);
		timer->Init();
		timer->setTimerType(GameObjects::BLOCK);
		timer->setTime(1500);
		this->composition->setInvicible(true);
		this->composition->setType(GameObjects::PLAYER_BLOCK);
		this->composition->sendMessage(new GameMessage::Message(GameMessage::BLOCK));
		timer->startTimer();
		isAtt3 = true;
	}