#include <player.h>
Public Member Functions | |
| Player (const std::string &name, IItemDefManager *idef) | |
| virtual | ~Player ()=0 |
| DISABLE_CLASS_COPY (Player) | |
| void | setSpeed (v3f speed) |
| v3f | getSpeed () const |
| const std::string & | getName () const |
| const PlayerControl & | getPlayerControl () |
| ItemStack & | getWieldedItem (ItemStack *selected, ItemStack *hand) const |
| void | setWieldIndex (u16 index) |
| u16 | getWieldIndex () |
| bool | setFov (const PlayerFovSpec &spec) |
| const PlayerFovSpec & | getFov () const |
| u16 | getMaxHotbarItemcount () |
Public Attributes | |
| CameraMode | allowed_camera_mode = CAMERA_MODE_ANY |
| v3f | eye_offset_first |
| v3f | eye_offset_third |
| v3f | eye_offset_third_front |
| Inventory | inventory |
| f32 | movement_acceleration_default |
| f32 | movement_acceleration_air |
| f32 | movement_acceleration_fast |
| f32 | movement_speed_walk |
| f32 | movement_speed_crouch |
| f32 | movement_speed_fast |
| f32 | movement_speed_climb |
| f32 | movement_speed_jump |
| f32 | movement_liquid_fluidity |
| f32 | movement_liquid_fluidity_smooth |
| f32 | movement_liquid_sink |
| f32 | movement_gravity |
| std::array< v2f,(size_t) LocalPlayerAnimation::COUNT > | local_animations |
| Animation frame ranges for different local player animation "states". | |
| float | local_animation_speed |
| std::string | inventory_formspec |
| std::string | formspec_prepend |
| PlayerControl | control |
| PlayerPhysicsOverride | physics_override |
| PlayerHud | hud |
| u32 | hud_flags |
| s32 | hud_hotbar_itemcount |
Protected Attributes | |
| std::string | m_name |
| v3f | m_speed |
| u16 | m_wield_index = 0 |
| PlayerFovSpec | m_fov_override_spec = { 0.0f, false, 0.0f } |
| Player::Player | ( | const std::string & | name, |
| IItemDefManager * | idef ) |
References Inventory::addList(), BS, Inventory::clear(), HUD_FLAG_BASIC_DEBUG, HUD_FLAG_BREATHBAR_VISIBLE, HUD_FLAG_CHAT_VISIBLE, HUD_FLAG_CROSSHAIR_VISIBLE, HUD_FLAG_HEALTHBAR_VISIBLE, HUD_FLAG_HOTBAR_VISIBLE, HUD_FLAG_MINIMAP_RADAR_VISIBLE, HUD_FLAG_MINIMAP_VISIBLE, HUD_FLAG_WIELDITEM_VISIBLE, hud_flags, hud_hotbar_itemcount, HUD_HOTBAR_ITEMCOUNT_DEFAULT, inventory, inventory_formspec, local_animation_speed, m_name, movement_acceleration_air, movement_acceleration_default, movement_acceleration_fast, movement_gravity, movement_liquid_fluidity, movement_liquid_fluidity_smooth, movement_liquid_sink, movement_speed_climb, movement_speed_crouch, movement_speed_fast, movement_speed_jump, movement_speed_walk, PLAYER_INVENTORY_SIZE, Inventory::setModified(), and InventoryList::setWidth().
Referenced by LocalPlayer::LocalPlayer(), RemotePlayer::RemotePlayer(), and DISABLE_CLASS_COPY().
|
pure virtual |
| Player::DISABLE_CLASS_COPY | ( | Player | ) |
|
inline |
References m_fov_override_spec.
Referenced by Game::checkZoomEnabled(), ObjectRef::l_get_fov(), Camera::notifyFovChange(), and Server::SendPlayerFov().
| u16 Player::getMaxHotbarItemcount | ( | ) |
References Inventory::getList(), InventoryList::getSize(), hud_hotbar_itemcount, and inventory.
Referenced by Hud::drawHotbar(), getWieldIndex(), Server::handleCommand_Interact(), Server::handleCommand_PlayerItem(), ObjectRef::l_hud_get_hotbar_itemcount(), and Game::processItemSelection().
|
inline |
References m_name.
Referenced by ServerEnvironment::addPlayer(), Server::checkInteractDistance(), PlayerSAO::checkMovementCheat(), Server::DeleteClient(), PlayerDatabaseFiles::deSerialize(), Server::emergePlayer(), ServerEnvironment::getAddedActiveObjects(), PlayerSAO::getClientInitializationData(), PlayerSAO::getDescription(), Client::getInventory(), PlayerSAO::getInventoryLocation(), Server::getPlayerName(), ServerEnvironment::getRemovedActiveObjects(), Server::handleCommand_ChatMessage(), Server::handleCommand_ClientReady(), Server::handleCommand_Damage(), Server::handleCommand_Interact(), Server::handleCommand_InventoryAction(), Server::handleCommand_InventoryFields(), Server::handleCommand_NodeMetaFields(), Server::handleCommand_PlayerItem(), Server::handleCommand_PlayerPos(), Server::HandlePlayerDeath(), ObjectRef::l_get_meta(), LuaLocalPlayer::l_get_name(), ObjectRef::l_get_player_name(), ObjectRef::l_set_formspec_prepend(), ObjectRef::l_set_inventory_formspec(), ObjectRef::l_set_observers(), PlayerDatabaseFiles::listPlayers(), Database_Dummy::loadPlayer(), PlayerDatabaseFiles::loadPlayer(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), ServerEnvironment::loadPlayer(), Server::playSound(), GenericCAO::processInitData(), PlayerDatabaseFiles::removePlayer(), Server::reportPrivsModified(), PlayerSAO::respawn(), Database_Dummy::savePlayer(), PlayerDatabaseFiles::savePlayer(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), ServerEnvironment::savePlayer(), Server::SendAddParticleSpawner(), Server::SendPlayerPrivileges(), PlayerDatabaseFiles::serialize(), Server::StageTwoClientInit(), Client::startAuth(), Client::step(), Server::UpdateCrafting(), and ClientInterface::UpdatePlayerList().
|
inline |
References control.
Referenced by LuaLocalPlayer::l_get_control(), ObjectRef::l_get_player_control(), ObjectRef::l_get_player_control_bits(), GenericCAO::step(), and Camera::update().
|
inline |
References m_speed.
Referenced by LocalPlayer::applyControl(), RemoteClient::GetNextBlocks(), LuaLocalPlayer::l_get_velocity(), ObjectRef::l_get_velocity(), LocalPlayer::move(), LocalPlayer::old_move(), Client::sendPlayerPos(), ClientEnvironment::step(), Camera::update(), Game::updateSound(), and writePlayerPos().
References InventoryList::getItem(), Inventory::getList(), inventory, m_wield_index, and ItemStack::name.
Referenced by Server::checkInteractDistance(), PlayerSAO::getWieldedItem(), Server::handleCommand_Interact(), LuaLocalPlayer::l_get_wielded_item(), Game::processPlayerInteraction(), Game::updateCamera(), and Game::updateFrame().
| u16 Player::getWieldIndex | ( | ) |
References getMaxHotbarItemcount(), and m_wield_index.
Referenced by Hud::drawHotbar(), PlayerSAO::getWieldIndex(), Client::interact(), LuaLocalPlayer::l_get_wield_index(), Game::processItemSelection(), PlayerSAO::setWieldedItem(), and Game::updateFrame().
|
inline |
References m_fov_override_spec.
Referenced by Client::handleCommand_Fov(), and ObjectRef::l_set_fov().
|
inline |
References m_speed.
Referenced by LocalPlayer::applyControl(), LocalPlayer::move(), LocalPlayer::old_move(), Server::process_PlayerPos(), ClientEnvironment::step(), and PlayerSAO::step().
| void Player::setWieldIndex | ( | u16 | index | ) |
References Inventory::getList(), InventoryList::getSize(), inventory, m_wield_index, and MYMIN.
Referenced by Server::handleCommand_Interact(), Server::handleCommand_PlayerItem(), and Client::setPlayerItem().
| CameraMode Player::allowed_camera_mode = CAMERA_MODE_ANY |
| PlayerControl Player::control |
Referenced by LocalPlayer::applyControl(), getPlayerControl(), LocalPlayer::handleAutojump(), LocalPlayer::move(), LocalPlayer::old_move(), Server::process_PlayerPos(), Game::processPlayerInteraction(), Client::sendPlayerPos(), Client::setPlayerControl(), Game::updatePlayerControl(), and writePlayerPos().
| v3f Player::eye_offset_first |
| v3f Player::eye_offset_third |
| v3f Player::eye_offset_third_front |
| std::string Player::formspec_prepend |
| PlayerHud Player::hud |
Referenced by Hud::drawLuaElements(), Game::handleClientEvent_HudAdd(), Game::handleClientEvent_HudChange(), Game::handleClientEvent_HudRemove(), Hud::hasElementOfType(), Server::hudAdd(), Server::hudRemove(), ObjectRef::l_hud_change(), ObjectRef::l_hud_get(), ObjectRef::l_hud_get_all(), and Server::StageTwoClientInit().
| u32 Player::hud_flags |
| s32 Player::hud_hotbar_itemcount |
| Inventory Player::inventory |
Referenced by Player(), RemotePlayer::checkModified(), Game::createClient(), PlayerDatabaseFiles::deSerialize(), Client::getInventory(), PlayerSAO::getInventory(), getMaxHotbarItemcount(), getWieldedItem(), Client::handleCommand_Inventory(), PlayerDatabaseLevelDB::loadPlayer(), PlayerDatabaseSQLite3::loadPlayer(), PlayerDatabaseLevelDB::savePlayer(), PlayerDatabaseSQLite3::savePlayer(), Server::SendInventory(), PlayerDatabaseFiles::serialize(), ServerInventoryManager::setInventoryModified(), PlayerSAO::setWieldedItem(), setWieldIndex(), Client::step(), Server::UpdateCrafting(), and Client::updateWieldedItem().
| std::string Player::inventory_formspec |
| float Player::local_animation_speed |
| std::array<v2f, (size_t) LocalPlayerAnimation::COUNT> Player::local_animations |
Animation frame ranges for different local player animation "states".
Referenced by GenericCAO::applyTrackAnimation(), RemotePlayer::getLocalAnimations(), Client::handleCommand_LocalPlayerAnimations(), RemotePlayer::setLocalAnimations(), and GenericCAO::setLocalPlayerAnimation().
|
protected |
|
protected |
Referenced by Player(), RemotePlayer::canSendChatMessage(), PlayerDatabaseFiles::deSerialize(), and getName().
|
protected |
Referenced by LocalPlayer::accelerate(), getSpeed(), LocalPlayer::move(), LocalPlayer::old_move(), and setSpeed().
|
protected |
Referenced by getWieldedItem(), getWieldIndex(), and setWieldIndex().
| f32 Player::movement_acceleration_air |
| f32 Player::movement_acceleration_default |
| f32 Player::movement_acceleration_fast |
| f32 Player::movement_gravity |
| f32 Player::movement_liquid_fluidity |
| f32 Player::movement_liquid_fluidity_smooth |
| f32 Player::movement_liquid_sink |
| f32 Player::movement_speed_climb |
| f32 Player::movement_speed_crouch |
| f32 Player::movement_speed_fast |
| f32 Player::movement_speed_jump |
| f32 Player::movement_speed_walk |
| PlayerPhysicsOverride Player::physics_override |
Referenced by ParticleManager::addNodeParticle(), LocalPlayer::applyControl(), PlayerSAO::checkMovementCheat(), PlayerSAO::generateUpdatePhysicsOverrideCommand(), LocalPlayer::handleAutojump(), LuaLocalPlayer::l_get_physics_override(), ObjectRef::l_get_physics_override(), ObjectRef::l_set_physics_override(), LocalPlayer::move(), LocalPlayer::old_move(), GenericCAO::processMessage(), ClientEnvironment::step(), and LocalPlayer::updateSneakNode().