示例#1
0
void Service::SetPlaceDistributionPolicy(std::wstring const& distPolicy)
{
    if (distPolicy.front() == L'N' || distPolicy.front() == L'n')
    {
        this->partiallyPlace_ = false;
    }
    else
    {
        this->partiallyPlace_ = true;
    }
}
示例#2
0
PictureElement(sf::Texture& texture, sf::IntRect textureSectionRect,
		int index, std::wstring word, sf::Vector2f pos )
    : missed_(false)
    , revealed_(false)
    , active_(false)
    , index_(index)
    , word_(word)
    , nextLetter_(word.front())
    //, scheduler_(sf::seconds(3.f), []() {  })
{
    const int charFontSize {22};
    const int charWidth {14};
    const int charHeight {24};

    sprite_.setTexture(texture);
    sprite_.setTextureRect(textureSectionRect);
    sprite_.setPosition(pos);

    wordText_.setFont(framework::ResourceHolder::get().fonts.get("arial"));
    wordText_.setPosition(sf::Vector2f(
    						pos.x + sprite_.getTextureRect().width / 2.f ,
							pos.y + sprite_.getTextureRect().height/ 2.f));
    wordText_.setString(word);
    wordText_.setCharacterSize(charFontSize);
    //wordText_.setColor(sf::Color::White);
    wordText_.setStyle(sf::Text::Bold);
    wordText_.setOrigin(0, 0);

    //timer_.restart();
    
    //shape.setSize(sf::Vector2f(word.length() * charWidth, charHeight));

    LOG_INFO("PictureElement:" << word_);
}
示例#3
0
ItRange<uint16_t*> RangeFromString(std::wstring& str) {
  auto s = reinterpret_cast<uint16_t*>(&str.front());
  return ItRange<uint16_t*>(s, s + str.size());
}