aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/textures/at_il_tool.png
blob: f6ce1cc7f908354a8e3eeba940f3da14d261c815 (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 06 00 00 00 1f f3 ff .PNG........IHDR................
0020 61 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 93 00 00 00 09 70 48 59 73 00 00 0b 13 00 a....bKGD..............pHYs.....
0040 00 0b 13 01 00 9a 9c 18 00 00 00 07 74 49 4d 45 07 e2 0a 1a 11 09 0f be d5 d0 ec 00 00 00 de 49 ............tIME...............I
0060 44 41 54 38 cb cd 93 31 6a c3 30 14 40 9f 14 23 07 93 52 08 74 48 0e 90 21 19 db a9 50 42 0c c9 DAT8...1j.0.@..#..R.tH..!...PB..
0080 e6 2c de bb f7 30 bd 43 4f 90 31 43 06 0f 1d 4b e7 2e 86 0c ba 80 87 5a a6 ad 51 d4 a5 94 0c 36 .,...0.CO.1C...K.......Z..Q....6
00a0 96 b7 bc 55 ff bd e1 7f 24 f0 e4 d6 3d 8e 81 35 b0 01 be 81 3d f0 1a e0 cf c3 09 f7 5c 52 4d 01 ...U....$...=..5....=.......\RM.
00c0 37 22 5a 4a c4 93 ec 11 b8 2f a9 26 79 ad 45 5e 6b 59 52 cd 80 bb 3e 01 fd c5 cf f9 bc 05 aa 81 7"ZJ...../.&y.E^kYR...>.........
00e0 af bd ca 17 6f 9f c1 35 cc 2d d3 c1 8d 89 18 1e 24 f2 45 f8 c8 49 92 b8 30 0c b1 d6 a2 77 57 5b ....o..5.-......$.E..I..0....wW[
0100 40 01 1f c0 d1 4b 5e f0 ee e2 38 76 4d ef a2 4b 56 4a 51 14 05 59 96 89 5e 01 1f b9 35 e0 2b 37 @....K^...8vM..KVJQ..Y..^...5.+7
0120 06 fa c8 4d 38 a0 75 61 9d db 4e d3 d4 fd 45 bc f9 ff 0b c6 18 8c 31 9d 97 b9 3c 7e 01 4a 59 59 ...M8.ua..N...E.......1...<~.JYY
0140 68 78 b5 46 25 00 00 00 00 49 45 4e 44 ae 42 60 82 hx.F%....IEND.B`.
ef='#n114'>114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
/*
Minetest
Copyright (C) 2010-2013 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 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.
*/

#ifndef ENVIRONMENT_HEADER
#define ENVIRONMENT_HEADER

/*
	This class is the game's environment.
	It contains:
	- The map
	- Players
	- Other objects
	- The current time in the game
	- etc.
*/

#include <set>
#include "irrlichttypes_extrabloated.h"
#include "player.h"
#include <ostream>
#include "activeobject.h"
#include "util/container.h"
#include "util/numeric.h"
#include "mapnode.h"
#include "mapblock.h"

class ServerEnvironment;
class ActiveBlockModifier;
class ServerActiveObject;
typedef struct lua_State lua_State;
class ITextureSource;
class IGameDef;
class Map;
class ServerMap;
class ClientMap;

class Environment
{
public:
	// Environment will delete the map passed to the constructor
	Environment();
	virtual ~Environment();

	/*
		Step everything in environment.
		- Move players
		- Step mobs
		- Run timers of map
	*/
	virtual void step(f32 dtime) = 0;

	virtual Map & getMap() = 0;

	virtual void addPlayer(Player *player);
	void removePlayer(u16 peer_id);
	Player * getPlayer(u16 peer_id);
	Player * getPlayer(const char *name);
	Player * getRandomConnectedPlayer();
	Player * getNearestConnectedPlayer(v3f pos);
	core::list<Player*> getPlayers();
	core::list<Player*> getPlayers(bool ignore_disconnected);
	void printPlayers(std::ostream &o);
	
	u32 getDayNightRatio();
	
	// 0-23999
	virtual void setTimeOfDay(u32 time)
	{
		m_time_of_day = time;
		m_time_of_day_f = (float)time / 24000.0;
	}

	u32 getTimeOfDay()
	{ return m_time_of_day; }

	float getTimeOfDayF()
	{ return m_time_of_day_f; }

	void stepTimeOfDay(float dtime);

	void setTimeOfDaySpeed(float speed)
	{ m_time_of_day_speed = speed; }
	
	float getTimeOfDaySpeed()
	{ return m_time_of_day_speed; }

protected:
	// peer_ids in here should be unique, except that there may be many 0s
	core::list<Player*> m_players;
	// Time of day in milli-hours (0-23999); determines day and night
	u32 m_time_of_day;
	// Time of day in 0...1
	float m_time_of_day_f;
	float m_time_of_day_speed;
	// Used to buffer dtime for adding to m_time_of_day
	float m_time_counter;
};

/*
	Active block modifier interface.

	These are fed into ServerEnvironment at initialization time;
	ServerEnvironment handles deleting them.
*/

class ActiveBlockModifier
{
public: