• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetOrientation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetOrientation函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOrientation函数的具体用法?C++ GetOrientation怎么用?C++ GetOrientation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetOrientation函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wxT

bool LIB_TEXT::Save( OUTPUTFORMATTER& aFormatter )
{
    wxString text = m_Text;

    if( text.Contains( wxT( "~" ) ) || text.Contains( wxT( "\"" ) ) )
    {
        // convert double quote to similar-looking two apostrophes
        text.Replace( wxT( "\"" ), wxT( "''" ) );
        text = wxT( "\"" ) + text + wxT( "\"" );
    }
    else
    {
        // Spaces are not allowed in text because it is not double quoted:
        // changed to '~'
        text.Replace( wxT( " " ), wxT( "~" ) );
    }

    aFormatter.Print( 0, "T %g %d %d %d %d %d %d %s ", GetOrientation(), m_Pos.x, m_Pos.y,
                      m_Size.x, m_Attributs, m_Unit, m_Convert, TO_UTF8( text ) );

    aFormatter.Print( 0, " %s %d", m_Italic ? "Italic" : "Normal", ( m_Bold > 0 ) ? 1 : 0 );

    char hjustify = 'C';

    if( m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
        hjustify = 'L';
    else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
        hjustify = 'R';

    char vjustify = 'C';

    if( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
        vjustify = 'B';
    else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
        vjustify = 'T';

    aFormatter.Print( 0, " %c %c\n", hjustify, vjustify );

    return true;
}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:40,代码来源:lib_text.cpp


示例2: GetMap

void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
    Map const* oldMap = GetMap();
    Relocate(x, y, z);

    // we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
    // player far teleport would try to create same instance, but we need it NOW for transport...
    RemoveFromWorld();
    ResetMap();
    Map* newMap = sMapMgr->CreateBaseMap(newMapid);
    SetMap(newMap);
    ASSERT(GetMap());
    AddToWorld();

    for (UnitSet::iterator itr = _passengers.begin(); itr != _passengers.end();)
    {
        Unit* passenger = *itr;
        ++itr;

        switch (passenger->GetTypeId())
        {
            case TYPEID_UNIT:
                passenger->ToCreature()->FarTeleportTo(newMap, x, y, z, passenger->GetOrientation());
                break;
            case TYPEID_PLAYER:
                if (passenger->isDead() && !passenger->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
                    passenger->ToPlayer()->ResurrectPlayer(1.0f);
                passenger->ToPlayer()->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
                break;
        }
    }

    if (oldMap != newMap)
    {
        UpdateForMap(oldMap);
        UpdateForMap(newMap);
    }

    MoveToNextWayPoint();
}
开发者ID:Devilcleave,项目名称:TrilliumEMU,代码行数:40,代码来源:Transport.cpp


示例3: GetMap

void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
    Map const* oldMap = GetMap();
    SetMapId(newMapid);

    Relocate(x, y, z);

    for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
    {
        PlayerSet::iterator it2 = itr;
        ++itr;

        Player *plr = *it2;
        if (!plr)
        {
            m_passengers.erase(it2);
            continue;
        }

        if (plr->isDead() && !plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
        {
            plr->ResurrectPlayer(1.0);
        }
        plr->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);

        //WorldPacket data(SMSG_811, 4);
        //data << uint32(0);
        //plr->BroadcastPacketToSelf(&data);
    }

    Map* newMap = sMapMgr.CreateMap(newMapid, this);

    SetMap(newMap);

    if (oldMap != newMap)
    {
        UpdateForMap(oldMap);
        UpdateForMap(newMap);
    }
}
开发者ID:Blumfield,项目名称:ptc2,代码行数:40,代码来源:Transports.cpp


示例4: GetMap

void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
    Map const* oldMap = GetMap();
    Relocate(x, y, z);

    for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
    {
        PlayerSet::iterator it2 = itr;
        ++itr;

        Player* plr = *it2;
        if (!plr)
        {
            m_passengers.erase(it2);
            continue;
        }

        if (plr->isDead() && !plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
        {
            plr->ResurrectPlayer(1.0);
        }
        plr->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);

        // WorldPacket data(SMSG_811, 4);
        // data << uint32(0);
        // plr->GetSession()->SendPacket(&data);
    }

    // we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
    // player far teleport would try to create same instance, but we need it NOW for transport...
    // correct me if I'm wrong O.o
    Map* newMap = sMapMgr.CreateMap(newMapid, this);
    SetMap(newMap);

    if (oldMap != newMap)
    {
        UpdateForMap(oldMap);
        UpdateForMap(newMap);
    }
}
开发者ID:Celtus,项目名称:portalone,代码行数:40,代码来源:Transports.cpp


示例5: switch

void SCH_TEXT::MirrorX( int aXaxis_position )
{
    // Text is NOT really mirrored; it is moved to a suitable position
    // which is the closest position for a true mirrored text
    // The center position is mirrored and the text is moved for half
    // horizontal len
    int py = m_Pos.y;
    int dy;

    switch( GetOrientation() )
    {
    case 0:             /* horizontal text */
        dy = -m_Size.y / 2;
        break;

    case 1: /* Vert Orientation UP */
        dy = -LenSize( m_Text ) / 2;
        break;

    case 2:                 /* invert horizontal text*/
        dy = m_Size.y / 2;  // how to calculate text height?
        break;

    case 3: /*  Vert Orientation BOTTOM */
        dy = LenSize( m_Text ) / 2;
        break;

    default:
        dy = 0;
        break;
    }

    py += dy;
    py -= aXaxis_position;
    NEGATE( py );
    py += aXaxis_position;
    py -= dy;
    m_Pos.y = py;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:39,代码来源:sch_text.cpp


示例6: elemrect

void ProgressBar::OnRender(suic::DrawingContext * drawing)
{
    // 先绘制背景
    suic::Rect elemrect(0, 0, RenderSize().cx, RenderSize().cy);

    suic::TriggerPtr trg(suic::UIRender::GetTriggerByStatus(this, GetStyle()));
    suic::UIRender::DrawBackground(drawing, trg, &elemrect);

    //
    // 绘制进度条状态
    //
    suic::ImageBrushPtr bkgnd(trg->GetValue(_T("Thumb")));

    if (bkgnd)
    {
        suic::Rect rcdraw(elemrect);

        // 水平
        if (GetOrientation() == CoreFlags::Horizontal)
        {
            LONG iOff = (LONG)((GetValue() - Minimum()) * (double)(rcdraw.right - rcdraw.left) / (Maximum() - Minimum()));
            rcdraw.right = rcdraw.left + iOff;
        }
        else
        {
            LONG iOff = (LONG)((double)(rcdraw.bottom - rcdraw.top) * (GetValue() - Minimum()) / (Maximum() - Minimum()));
            rcdraw.top = rcdraw.bottom - iOff;
        }

        if (!rcdraw.Empty())
        {
            bkgnd->Draw(drawing, &rcdraw);
        }
    }

    suic::UIRender::DrawText(drawing, GetText(), trg, &elemrect
        , GetHorizontalContentAlignment(), GetVerticalContentAlignment());
}
开发者ID:tfzxyinhao,项目名称:sharpui,代码行数:38,代码来源:ProgressBar.cpp


示例7: orderVertices

void 
AngularlyOrderedGraph::Initialize(vector<Vertex<FragmentInfo>*>& v, 
								  vector<ContourEQW>& contours, 
								  FragmentInfo& start,
								  FragmentInfo& end)
{
	for(int i=0; i<vertices.size(); ++i)
	{
		delete vertices[i];
	}
	vertices.clear();

	for(int i=0; i<v.size(); ++i)
	{
		Vertex<FragmentInfo>* u = new Vertex<FragmentInfo>(v[i]->key);
		*u = *(v[i]);
		vertices.push_back(u);
	}

	vertices = orderVertices(vertices, contours, click);
	source = findVertex(vertices, start);
	assert(source);
	dest = findVertex(vertices, end);
	assert(dest);
	if(GetOrientation(start, end, click, contours)==false)
	{
		swap(source, dest);
	}

	vertices = arrangeVertices(vertices, source);

	for(int i=0; i<vertices.size(); ++i)
	{
		vertices[i]->Reset();
	}
	source->d = 0;
	iter = 1;
}
开发者ID:toshirokubota,项目名称:MovingDots,代码行数:38,代码来源:AngularlyOrderedGraph.cpp


示例8: GetOrientation

void AreaTrigger::UpdatePolygonOrientation()
{
    float newOrientation = GetOrientation();

    // No need to recalculate, orientation didn't change
    if (G3D::fuzzyEq(_previousCheckOrientation, newOrientation))
        return;

    _polygonVertices.assign(GetTemplate()->PolygonVertices.begin(), GetTemplate()->PolygonVertices.end());

    float angleSin = std::sin(newOrientation);
    float angleCos = std::cos(newOrientation);

    // This is needed to rotate the vertices, following orientation
    for (Position& vertice : _polygonVertices)
    {
        float x = vertice.GetPositionX() * angleCos - vertice.GetPositionY() * angleSin;
        float y = vertice.GetPositionY() * angleCos + vertice.GetPositionX() * angleSin;
        vertice.Relocate(x, y);
    }

    _previousCheckOrientation = newOrientation;
}
开发者ID:Rochet2,项目名称:TrinityCore,代码行数:23,代码来源:AreaTrigger.cpp


示例9: InternalInit

void ScrollBar::InternalInit()
{
    if (GetOrientation() == CoreFlags::Horizontal)
    {
        if (GetHeight() > 0)
        {
            _decreaseBtn.SetWidth(GetHeight());
            _decreaseBtn.SetHeight(GetHeight());
            _increaseBtn.SetWidth(GetHeight());
            _increaseBtn.SetHeight(GetHeight());
        }
    }
    else
    {
        if (GetWidth() > 0)
        {
            _decreaseBtn.SetWidth(GetWidth());
            _decreaseBtn.SetHeight(GetWidth());
            _increaseBtn.SetWidth(GetWidth());
            _increaseBtn.SetHeight(GetWidth());
        }
    }
}
开发者ID:tfzxyinhao,项目名称:sharpui,代码行数:23,代码来源:ScrollBar.cpp


示例10: VALUES

void GameObject::SaveToDB()
{
	std::stringstream ss;
	ss << "REPLACE INTO gameobject_spawns VALUES("
		<< ((m_spawn == NULL) ? 0 : m_spawn->id) << ","
		<< GetEntry() << ","
		<< GetMapId() << ","
		<< GetPositionX() << ","
		<< GetPositionY() << ","
		<< GetPositionZ() << ","
		<< GetOrientation() << ","
		<< GetUInt64Value(GAMEOBJECT_ROTATION) << ","
		<< GetFloatValue(GAMEOBJECT_PARENTROTATION) << ","
		<< GetFloatValue(GAMEOBJECT_PARENTROTATION + 2) << ","
		<< GetFloatValue(GAMEOBJECT_PARENTROTATION + 3) << ","
		<< ( GetByte(GAMEOBJECT_BYTES_1, 0)? 1 : 0 ) << ","
		<< GetUInt32Value(GAMEOBJECT_FLAGS) << ","
		<< GetUInt32Value(GAMEOBJECT_FACTION) << ","
		<< GetFloatValue(OBJECT_FIELD_SCALE_X) << ","
		<< m_phaseMode << ","
		<< m_phaseMode << ")";
	WorldDatabase.Execute(ss.str().c_str());
}
开发者ID:arcticdev,项目名称:arctic-test,代码行数:23,代码来源:GameObject.cpp


示例11: GetPosition

void D_PAD::Flip( const wxPoint& aCentre )
{
    int y = GetPosition().y;
    MIRROR( y, aCentre.y );  // invert about x axis.
    SetY( y );

    MIRROR( m_Pos0.y, 0 );
    MIRROR( m_Offset.y, 0 );
    MIRROR( m_DeltaSize.y, 0 );

    SetOrientation( -GetOrientation() );

    // flip pads layers
    // PADS items are currently on all copper layers, or
    // currently, only on Front or Back layers.
    // So the copper layers count is not taken in account
    SetLayerSet( FlipLayerMask( m_layerMask ) );

    // Flip the basic shapes, in custom pads
    FlipPrimitives();

    // m_boundingRadius = -1;  the shape has not been changed
}
开发者ID:cpavlina,项目名称:kicad,代码行数:23,代码来源:class_pad.cpp


示例12: size

suic::Size ScrollBar::MeasureOverride(const suic::Size& availableSize)
{
    suic::Size size(availableSize);

    //InternalInit();

    _decreaseBtn.Measure(size);
    _increaseBtn.Measure(size);
    _thumb.Measure(size);
    _decreasePage.Measure(size);
    _increasePage.Measure(size);

    if (GetOrientation() == CoreFlags::Horizontal)
    {
        size.cy = _decreaseBtn.GetDesiredSize().cy;
    }
    else
    {
        size.cx = _decreaseBtn.GetDesiredSize().cx;
    }

    return size;
}
开发者ID:tfzxyinhao,项目名称:sharpui,代码行数:23,代码来源:ScrollBar.cpp


示例13: switch

    void Node::Translate(const Vector3& delta, TransformSpace space)
    {
        switch (space)
        {
            case TS_LOCAL:
                // Note: local space translation disregards local scale for scale-independent movement speed
                position_ += GetOrientation() * delta;
                break;

            case TS_PARENT:
                position_ += delta;
                break;

            case TS_WORLD:
                {
                    PNode parent = parent_.lock();
                    position_ += (parent == scene_.lock() || !parent) ? delta : Vector3(parent->GetGlobalModelInvMatrix() * Vector4(delta, 0.0f));
                    break;
                }
        }

        MarkAsDirty();
    }
开发者ID:dreamsxin,项目名称:nsg-library,代码行数:23,代码来源:Node.cpp


示例14: OnKeyDown

void Slider::OnKeyDown(suic::KeyEventArg& e)
{
    if (GetOrientation() == CoreFlags::Horizontal) 
    {
        if (e.IsLeftArrow())
        {
            if (GetValue() > Minimum())
            {
                SetValue((int)GetValue() - 1);
            }
        }
        else if (e.IsRightArrow())
        {
            if (GetValue() < Maximum())
            {
                SetValue((int)GetValue() + 1);
            }
        }
    }
    else
    {
        if (e.IsUpArrow())
        {
            if (GetValue() > Minimum())
            {
                SetValue((int)GetValue() - 1);
            }
        }
        else if (e.IsDownArrow())
        {
            if (GetValue() < Maximum())
            {
                SetValue((int)GetValue() + 1);
            }
        }
    }
}
开发者ID:tfzxyinhao,项目名称:sharpui,代码行数:37,代码来源:Slider.cpp


示例15: RemoveFromWorld

void Transporter::TeleportTransport(uint32 newMapid, uint32 oldmap, float x, float y, float z)
{
    //sEventMgr.RemoveEvents(this, EVENT_TRANSPORTER_NEXT_WAYPOINT);

    RemoveFromWorld(false);
    SetMapId(newMapid);
    SetPosition(x, y, z, m_position.o, false);
    AddToWorld();

    WorldPacket packet(SMSG_TRANSFER_PENDING, 12);
    packet << newMapid;
    packet << getEntry();
    packet << oldmap;

    for (auto passengerGuid : m_passengers)
    {
        auto passenger = objmgr.GetPlayer(passengerGuid);
        if (passenger == nullptr)
            continue;

        passenger->GetSession()->SendPacket(&packet);
        bool teleport_successful = passenger->Teleport(LocationVector(x, y, z, passenger->GetOrientation()), this->GetMapMgr());
        if (!teleport_successful)
        {
            passenger->RepopAtGraveyard(passenger->GetPositionX(), passenger->GetPositionY(), passenger->GetPositionZ(), passenger->GetMapId());
        }
        else
        {
            if (!passenger->HasUnitMovementFlag(MOVEFLAG_TRANSPORT))
            {
                passenger->AddUnitMovementFlag(MOVEFLAG_TRANSPORT);
            }
        }
    }

    this->RespawnCreaturePassengers();
}
开发者ID:armm77,项目名称:AscEmu,代码行数:37,代码来源:TransporterHandler.cpp


示例16: RemoveComponent

void RPG_DestructibleEntity::SetDestroyed()
{
  m_isDestroyed = true;

  // remove the attackable component
  RPG_AttackableComponent* attackableComponent = static_cast<RPG_AttackableComponent*>(Components().GetComponentOfType(V_RUNTIME_CLASS(RPG_AttackableComponent)));
  if (attackableComponent)
  {
    RemoveComponent(attackableComponent);
  }

  vHavokRigidBody* rigidBodyComponent = static_cast<vHavokRigidBody*>(Components().GetComponentOfType(V_RUNTIME_CLASS(vHavokRigidBody)));
  if (rigidBodyComponent)
  {
    RemoveComponent(rigidBodyComponent);
  }

  // stop the ambient effect
  StopEffect(DEFX_Ambient);
  CreateEffect(DEFX_Destroy, GetPosition(), GetOrientation());

  // remove collision if so instructed
  //if (m_removeCollisionAfterDestruction)
  {
    RemoveObstacle();
  }

  if(!m_postDestructionMeshFilename.IsEmpty())
  {
    // swap the mesh
    SetMesh(m_postDestructionMeshFilename);
  }
  else
  {
    DisposeObject();
  }
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:37,代码来源:DestructibleEntity.cpp


示例17: GlobalLock

void PrintManager::InformTerOfCurrentPrinterSelection(CWSPrintRevisionReportDlg& dlgPrint)
{
	TERTCHAR device[MAX_WIDTH + 1];
	TERTCHAR driver[MAX_WIDTH + 1];
	TERTCHAR port[MAX_WIDTH + 1];

	PRINTDLG pdlg=dlgPrint.m_pd;

	// Get the new orietation
	PDEVMODE pDevMode= (PDEVMODE) GlobalLock(pdlg.hDevMode);
	m_NewOrient=pDevMode->dmOrientation;
	GlobalUnlock(pdlg.hDevMode);

	CString PortName = dlgPrint.GetPortName();
	CString DriverName = dlgPrint.GetDriverName();
	CString DeviceName = dlgPrint.GetDeviceName();

	ASSERT( PortName.GetLength() <= MAX_WIDTH );
	ASSERT( DriverName.GetLength() <= MAX_WIDTH );
	ASSERT( DeviceName.GetLength() <= MAX_WIDTH );

	tertstrcpyn((LPTSTR)device, DeviceName, MAX_WIDTH);
	tertstrcpyn((LPTSTR)driver, DriverName, MAX_WIDTH);
	tertstrcpyn((LPTSTR)port, PortName, MAX_WIDTH);

	// update printer selection for this view
	TerSetPrinter(this->m_hWnd, device, driver, port, pdlg.hDevMode);

	// Get the current orientation
	m_SaveOrient = GetOrientation();

	m_iCurSectOrient = TerGetSectOrient(this->m_hWnd, -1);
	if(m_SaveOrient!=m_NewOrient && m_iCurSectOrient!=m_NewOrient)
	{
		TerSetSectOrient(this->m_hWnd, m_NewOrient, TRUE);
	}
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:37,代码来源:PrintManager.cpp


示例18: ValueFromString

// Called when a pin properties changes
void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
{
    if( ! IsShown() )   // do nothing at init time
        return;

    int pinNameSize = ValueFromString( g_UserUnit, GetPinNameTextSize() );
    int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
    int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
    int pinLength = ValueFromString( g_UserUnit, GetLength() );
    GRAPHIC_PINSHAPE pinShape = GetStyle();
    ELECTRICAL_PINTYPE pinType = GetElectricalType();

    m_dummyPin->SetName( GetPinName() );
    m_dummyPin->SetNameTextSize( pinNameSize );
    m_dummyPin->SetNumber( GetPadName() );
    m_dummyPin->SetNumberTextSize( pinNumSize );
    m_dummyPin->SetOrientation( pinOrient );
    m_dummyPin->SetLength( pinLength );
    m_dummyPin->SetShape( pinShape );
    m_dummyPin->SetVisible( GetVisible() );
    m_dummyPin->SetType( pinType );

    m_panelShowPin->Refresh();
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:25,代码来源:dialog_lib_edit_pin.cpp


示例19: DeleteFromDB

void Corpse::SaveToDB()
{
    // prevent DB data inconsistence problems and duplicates
    SQLTransaction trans = CharacterDatabase.BeginTransaction();
    DeleteFromDB(trans);

    uint16 index = 0;
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
    stmt->setUInt64(index++, GetOwnerGUID().GetCounter());                            // guid
    stmt->setFloat (index++, GetPositionX());                                         // posX
    stmt->setFloat (index++, GetPositionY());                                         // posY
    stmt->setFloat (index++, GetPositionZ());                                         // posZ
    stmt->setFloat (index++, GetOrientation());                                       // orientation
    stmt->setUInt16(index++, GetMapId());                                             // mapId
    stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_DISPLAY_ID));                // displayId
    stmt->setString(index++, _ConcatFields(CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END));   // itemCache
    stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_BYTES_1));                   // bytes1
    stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_BYTES_2));                   // bytes2
    stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_FLAGS));                     // flags
    stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS));             // dynFlags
    stmt->setUInt32(index++, uint32(m_time));                                         // time
    stmt->setUInt8 (index++, GetType());                                              // corpseType
    stmt->setUInt32(index++, GetInstanceId());                                        // instanceId
    trans->Append(stmt);

    for (uint32 phaseId : GetPhases())
    {
        index = 0;
        stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE_PHASES);
        stmt->setUInt64(index++, GetOwnerGUID().GetCounter());                        // OwnerGuid
        stmt->setUInt32(index++, phaseId);                                            // PhaseId
        trans->Append(stmt);
    }

    CharacterDatabase.CommitTransaction(trans);
}
开发者ID:doriangray2,项目名称:TrinityCore-devil,代码行数:36,代码来源:Corpse.cpp


示例20: VALUES

void Creature::SaveToDB()
{
    sDatabase.BeginTransaction();

    sDatabase.PExecuteLog("DELETE FROM `creature` WHERE `guid` = '%u'", m_DBTableGuid);

    std::ostringstream ss;
    ss << "INSERT INTO `creature` VALUES ("
        << m_DBTableGuid << ","
        << GetEntry() << ","
        << GetMapId() <<","
        << GetPositionX() << ","
        << GetPositionY() << ","
        << GetPositionZ() << ","
        << GetOrientation() << ","
        << m_respawnDelay << ","                            //respawn time
        << (float) 0  << ","                                //spawn distance (float)
        << (uint32) (0) << ","                              //currentwaypoint
        << respawn_cord[0] << ","                           //spawn_position_x
        << respawn_cord[1] << ","                           //spawn_position_y
        << respawn_cord[2] << ","                           //spawn_position_z
        << (float)(0) << ","                                //spawn_orientation
        << GetHealth() << ","                               //curhealth
        << GetPower(POWER_MANA) << ","                      //curmana

        << (uint32)(m_deathState) << ","                    // is it really death state or just state?
    //or
    //<< (uint32)(m_state) << ","                     // is it really death state or just state?

        << GetDefaultMovementType() << ","                  // default movement generator type
        << "'')";                                           // should save auras

    sDatabase.PExecuteLog( ss.str( ).c_str( ) );

    sDatabase.CommitTransaction();
}
开发者ID:chrayn,项目名称:mangos-06,代码行数:36,代码来源:Creature.cpp



注:本文中的GetOrientation函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetOrigin函数代码示例发布时间:2022-05-30
下一篇:
C++ GetOrient函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap