aboutsummaryrefslogtreecommitdiff
path: root/po/fr/minetest.po
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-07-12 11:53:05 +0200
committersfan5 <sfan5@live.de>2021-07-12 12:03:39 +0200
commit5c89a0e12a1e679180b14bf92bdcdb1614e3982e (patch)
treec47a4c5c638c836ac3cafb77934afb95d9c4aa83 /po/fr/minetest.po
parenteffb5356caee01c8bfa63e98974347aab01f96ef (diff)
downloadminetest-5c89a0e12a1e679180b14bf92bdcdb1614e3982e.tar.gz
minetest-5c89a0e12a1e679180b14bf92bdcdb1614e3982e.tar.bz2
minetest-5c89a0e12a1e679180b14bf92bdcdb1614e3982e.zip
Fix build on Ubuntu 16.04 and macOS
Apparently the C++ standard library is supposed to provide specializations of std::hash for enums (even in C++11) but those don't always work for whatever reason.
Diffstat (limited to 'po/fr/minetest.po')
0 files changed, 0 insertions, 0 deletions
id='n122' href='#n122'>122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2013-2020 Minetest core developers & community

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

#include "object_properties.h"
#include "serveractiveobject.h"

class UnitSAO : public ServerActiveObject
{
public:
	UnitSAO(ServerEnvironment *env, v3f pos);
	virtual ~UnitSAO() = default;

	u16 getHP() const { return m_hp; }
	// Use a function, if isDead can be defined by other conditions
	bool isDead() const { return m_hp == 0; }

	// Rotation
	void setRotation(v3f rotation) { m_rotation = rotation; }
	const v3f &getRotation() const { return m_rotation; }
	v3f getRadRotation() { return m_rotation * core::DEGTORAD; }

	// Deprecated
	f32 getRadYawDep() const { return (m_rotation.Y + 90.) * core::DEGTORAD; }

	// Armor groups
	inline bool isImmortal() const
	{
		return itemgroup_get(getArmorGroups(), "immortal");
	}
	void setArmorGroups(const ItemGroupList &armor_groups);
	const ItemGroupList &getArmorGroups() const;

	// Animation
	void setAnimation(v2f frame_range, float frame_speed, float frame_blend,
			bool frame_loop);
	void getAnimation(v2f *frame_range, float *frame_speed, float *frame_blend,
			bool *frame_loop);
	void setAnimationSpeed(float frame_speed);

	// Bone position
	void setBonePosition(const std::string &bone, v3f position, v3f rotation);
	void getBonePosition(const std::string &bone, v3f *position, v3f *rotation);

	// Attachments
	ServerActiveObject *getParent() const;
	inline bool isAttached() const { return getParent(); }
	void setAttachment(int parent_id, const std::string &bone, v3f position,
			v3f rotation, bool force_visible);
	void getAttachment(int *parent_id, std::string *bone, v3f *position,
			v3f *rotation, bool *force_visible) const;
	void clearChildAttachments();
	void clearParentAttachment();
	void addAttachmentChild(int child_id);
	void removeAttachmentChild(int child_id);
	const std::unordered_set<int> &getAttachmentChildIds() const;

	// Object properties
	ObjectProperties *accessObjectProperties();
	void notifyObjectPropertiesModified();
	void sendOutdatedData();

	// Update packets
	std::string generateUpdateAttachmentCommand() const;
	std::string generateUpdateAnimationSpeedCommand() const;
	std::string generateUpdateAnimationCommand() const;
	std::string generateUpdateArmorGroupsCommand() const;
	static std::string generateUpdatePositionCommand(const v3f &position,
			const v3f &velocity, const v3f &acceleration, const v3f &rotation,
			bool do_interpolate, bool is_movement_end, f32 update_interval);