ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 04 00 00 00 02 00 08 03 00 00 00 2b 13 ee | .PNG........IHDR.............+.. |
0020 | 8b 00 00 00 4e 50 4c 54 45 00 00 00 ff ff ff 63 63 63 f7 f7 f7 8c 8c 8c de de de ef ef ef bd bd | ....NPLTE......ccc.............. |
0040 | bd a5 a5 a5 d6 d6 d6 ce ce ce 7b 7b 7b e7 e7 e7 ad b5 ad c6 c6 c6 94 9c 94 e7 ef e7 d6 de d6 f7 | ..........{{{................... |
0060 | ff f7 bd c6 bd ef f7 ef ce d6 ce b5 b5 b5 de e7 de b5 bd b5 c6 ce c6 e0 d0 a4 7b 00 00 00 01 74 | ..........................{....t |
0080 | 52 4e 53 00 40 e6 d8 66 00 00 da 99 49 44 41 54 78 5e ec bd 87 76 dc 3c cf 35 8a cd de 24 7d e5 | RNS.@..f....IDATx^...v.<.5...$}. |
00a0 | 3f ed fe 6f f4 2c 03 83 05 0d 19 59 9e d8 c9 93 3c af b1 ec 21 c0 5a 44 42 14 a5 0d d2 6f a4 6f | ?..o.,.....Y....<...!.ZDB....o.o |
00c0 | fa a6 6f 6a de 09 e3 7c 63 77 60 bc 39 3b f6 03 44 04 10 de 5c da b0 bd 92 5e d2 49 b8 05 3b c0 | ..oj...|cw`.9;..D...\....^.I..;. |
00e0 | 71 18 ff 33 59 61 9f a4 90 28 05 fa ed f4 4d 00 b2 f2 01 c0 5d ec f7 7c 8e 64 12 30 31 80 b2 00 | q..3Ya...(....M.....]..|.d.01... |
0100 | 40 bf 8f 4a 02 08 04 a4 f2 37 5e 9e a5 3b fd 4e 46 ad 8a 5b 9b 88 cd b5 37 0e c7 8e fd dc e9 de | @..J.....7^..;.NF..[....7....... |
0120 | 79 32 ba 49 af e9 24 dc 82 63 29 71 51 00 5a d8 87 08 97 21 63 a7 7d d0 6f a7 6f 02 26 69 a1 e2 | y2.I..$..c)qQ.Z....!c.}.o.o.&i.. |
0140 | db 07 15 40 82 a3 3b 05 a0 fc ef 23 8f ce 23 af c3 ff 7c 1f 01 2f a6 00 16 2f bf cb 0f 35 5f 3e | ...@..;....#..#...|../.../...5_> |
0160 | ae 60 97 a9 e3 40 af 91 2a 80 df 47 d6 67 c0 da 9a e2 b5 fd c5 ab 9a 3a 50 a8 e0 d0 38 d7 14 22 | .`...@..*..G.g.........:P...8.." |
0180 | d1 96 90 36 ed 64 0a 15 48 59 5c 5f bb ac 49 c0 c1 12 e1 18 f0 45 65 50 af 00 de e2 35 cf e9 6e | ...6.d..HY\_..I......EeP....5..n |
01a0 | e8 48 48 07 11 35 20 76 22 aa a8 72 81 a5 30 d7 3c 52 21 16 83 15 a2 2e f5 ea 91 0e e9 07 c0 2a | .HH..5.v"..r..0.<R!............* |
01c0 | c5 1c 7b 6/*
Minetest-c55
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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 General Public License for more details.
You should have received a copy of the GNU 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.
*/
#ifndef NODEMETADATA_HEADER
#define NODEMETADATA_HEADER
#include "common_irrlicht.h"
#include <string>
#include <iostream>
/*
Used for storing:
Oven:
- Item that is being burned
- Burning time
- Item stack that is being heated
- Result item stack
Sign:
- Text
*/
class Inventory;
class NodeMetadata
{
public:
typedef NodeMetadata* (*Factory)(std::istream&);
NodeMetadata();
virtual ~NodeMetadata();
static NodeMetadata* deSerialize(std::istream &is);
void serialize(std::ostream &os);
// This usually is the CONTENT_ value
virtual u16 typeId() const = 0;
virtual NodeMetadata* clone() = 0;
virtual void serializeBody(std::ostream &os) = 0;
virtual std::string infoText() {return "";}
virtual Inventory* getInventory() {return NULL;}
// This is called always after the inventory is modified, before
// the changes are copied elsewhere
virtual void inventoryModified(){}
// A step in time. Returns true if metadata changed.
virtual bool step(float dtime) {return false;}
virtual bool nodeRemovalDisabled(){return false;}
// Used to make custom inventory menus.
// See format in guiInventoryMenu.cpp.
virtual std::string getInventoryDrawSpecString(){return "";}
protected:
static void registerType(u16 id, Factory f);
private:
static core::map<u16, Factory> m_types;
};
/*
List of metadata of all the nodes of a block
*/
class NodeMetadataList
{
public:
~NodeMetadataList();
void serialize(std::ostream &os);
void deSerialize(std::istream &is);
// Get pointer to data
NodeMetadata* get(v3s16 p);
// Deletes data
void remove(v3s16 p);
// Deletes old data and sets a new one
void set(v3s16 p, NodeMetadata *d);
// A step in time. Returns true if something changed.
bool step(float dtime);
private:
core::map<v3s16, NodeMetadata*> m_data;
};
#endif
|