Redstone: Add wires, redstone torches, levers (incomplete) and repeaters

This commit is contained in:
Er2
2024-04-07 16:51:01 +03:00
parent b8c01e085f
commit 6bdfe250a2
50 changed files with 1687 additions and 114 deletions

View File

@@ -0,0 +1,42 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#pragma once
#include <list>
#include "TorchTile.hpp"
#include "TorchUpdateEvent.hpp"
class RedStoneTorchTile : public TorchTile
{
public:
RedStoneTorchTile(int id, int texture, Material* pMtl);
bool isSignalSource() override;
int getTickDelay() override;
void onPlace(Level*, int x, int y, int z) override;
void onRemove(Level*, int x, int y, int z) override;
void neighborChanged(Level*, int x, int y, int z, int dir) override;
int getResource(int data, Random* random) override;
void tick(Level*, int, int, int, Random*) override;
int getSignal(LevelSource*, int x, int y, int z, int dir) override;
int getDirectSignal(LevelSource*, int x, int y, int z, int dir) override;
void animateTick(Level* level, int x, int y, int z, Random* random) override;
void updateNeighbors(Level*, int x, int y, int z, int id);
bool checkBurnOut(Level*, int x, int y, int z, bool b);
bool hasSignalFromBehind(Level*, int x, int y, int z);
bool isActive() {
return m_bActive;
}
private:
bool m_bActive;
static TorchUpdateEvents m_recentUpdates;
};