Renamed member variables and parameters.

This commit is contained in:
Arron Nelson 2025-01-30 13:01:01 -08:00
parent 16b56a7084
commit 89925fe820
6 changed files with 56 additions and 56 deletions

View File

@ -83,12 +83,12 @@ namespace ehs
virtual void Poll(const float &delta); virtual void Poll(const float &delta);
protected: protected:
bool HasSystem(UInt_64 sysHashId) const; bool HasSystem(UInt_64 sysId) const;
bool HasSystem(const Str_8& sysId) const; bool HasSystem(const Str_8& sysName) const;
NetSys* GetSystem(UInt_64 sysHashId) const; NetSys* GetSystem(UInt_64 sysId) const;
NetSys* GetSystem(const Str_8& sysId) const; NetSys* GetSystem(const Str_8& sysName) const;
}; };
} }

View File

@ -14,15 +14,15 @@ namespace ehs
private: private:
friend class NetSys; friend class NetSys;
UInt_64 hashId; UInt_64 id;
Str_8 id; Str_8 name;
public: public:
virtual ~NetOp() = default; virtual ~NetOp() = default;
NetOp(); NetOp();
NetOp(Str_8 id); NetOp(Str_8 name);
NetOp(NetOp &&op) noexcept; NetOp(NetOp &&op) noexcept;
@ -32,9 +32,9 @@ namespace ehs
NetOp &operator=(const NetOp &op); NetOp &operator=(const NetOp &op);
Str_8 GetId() const; UInt_64 GetId() const;
UInt_64 GetHashId() const; Str_8 GetName() const;
private: private:
virtual void Execute(NetChannel *channel, NetEnd *issuer, NetSys *sys, Serializer<UInt_64> &payload); virtual void Execute(NetChannel *channel, NetEnd *issuer, NetSys *sys, Serializer<UInt_64> &payload);

View File

@ -17,8 +17,8 @@ namespace ehs
friend class NetServerCh; friend class NetServerCh;
friend class NetClientCh; friend class NetClientCh;
UInt_64 hashId; UInt_64 id;
Str_8 id; Str_8 name;
Array<NetOp*> ops; Array<NetOp*> ops;
public: public:
@ -26,7 +26,7 @@ namespace ehs
NetSys(); NetSys();
NetSys(Str_8 id); NetSys(Str_8 name);
NetSys(NetSys &&sys) noexcept; NetSys(NetSys &&sys) noexcept;
@ -36,15 +36,15 @@ namespace ehs
NetSys &operator=(const NetSys &sys); NetSys &operator=(const NetSys &sys);
Str_8 GetId() const; UInt_64 GetId() const;
UInt_64 GetHashId() const; Str_8 GetName() const;
bool HasOperation(UInt_64 hashId) const; bool HasOperation(UInt_64 id) const;
bool AddOperation(NetOp *op); bool AddOperation(NetOp *op);
private: private:
void Execute(NetChannel *channel, NetEnd *endpoint, UInt_64 hashId, Serializer<UInt_64> &payload); void Execute(NetChannel *channel, NetEnd *issuer, UInt_64 opId, Serializer<UInt_64> &payload);
}; };
} }

View File

@ -138,10 +138,10 @@ namespace ehs
bool NetChannel::AddSystem(NetSys *sys) bool NetChannel::AddSystem(NetSys *sys)
{ {
if (sys->GetHashId() == internalSys) if (sys->GetId() == internalSys)
return false; return false;
if (HasSystem(sys->GetHashId())) if (HasSystem(sys->GetId()))
return false; return false;
systems.Push(sys); systems.Push(sys);
@ -163,31 +163,31 @@ namespace ehs
{ {
} }
bool NetChannel::HasSystem(const UInt_64 sysHashId) const bool NetChannel::HasSystem(const UInt_64 sysId) const
{ {
for (UInt_64 i = 0; i < systems.Size(); ++i) for (UInt_64 i = 0; i < systems.Size(); ++i)
if (systems[i]->GetHashId() == sysHashId) if (systems[i]->GetId() == sysId)
return true; return true;
return false; return false;
} }
bool NetChannel::HasSystem(const Str_8& sysId) const bool NetChannel::HasSystem(const Str_8& sysName) const
{ {
return HasSystem(sysId.Hash_64()); return HasSystem(sysName.Hash_64());
} }
NetSys* NetChannel::GetSystem(const UInt_64 sysHashId) const NetSys* NetChannel::GetSystem(const UInt_64 sysId) const
{ {
for (UInt_64 i = 0; i < systems.Size(); ++i) for (UInt_64 i = 0; i < systems.Size(); ++i)
if (systems[i]->GetHashId() == sysHashId) if (systems[i]->GetId() == sysId)
return systems[i]; return systems[i];
return nullptr; return nullptr;
} }
NetSys* NetChannel::GetSystem(const Str_8& sysId) const NetSys* NetChannel::GetSystem(const Str_8& sysName) const
{ {
return GetSystem(sysId.Hash_64()); return GetSystem(sysName.Hash_64());
} }
} }

View File

@ -5,23 +5,23 @@
namespace ehs namespace ehs
{ {
NetOp::NetOp() NetOp::NetOp()
: hashId(0) : id(0)
{ {
} }
NetOp::NetOp(Str_8 id) NetOp::NetOp(Str_8 name)
: hashId(id.Hash_64()), id((Str_8 &&)id) : id(name.Hash_64()), name((Str_8 &&)name)
{ {
} }
NetOp::NetOp(NetOp&& op) noexcept NetOp::NetOp(NetOp&& op) noexcept
: hashId(op.hashId), id((Str_8 &&)op.id) : id(op.id), name((Str_8 &&)op.name)
{ {
op.hashId = 0; op.id = 0;
} }
NetOp::NetOp(const NetOp &op) NetOp::NetOp(const NetOp &op)
: hashId(op.hashId), id(op.id) : id(op.id), name(op.name)
{ {
} }
@ -30,10 +30,10 @@ namespace ehs
if (this == &op) if (this == &op)
return *this; return *this;
hashId = op.hashId; id = op.id;
id = (Str_8 &&)op.id; name = (Str_8 &&)op.name;
op.hashId = 0; op.id = 0;
return *this; return *this;
} }
@ -43,20 +43,20 @@ namespace ehs
if (this == &op) if (this == &op)
return *this; return *this;
hashId = op.hashId;
id = op.id; id = op.id;
name = op.name;
return *this; return *this;
} }
Str_8 NetOp::GetId() const UInt_64 NetOp::GetId() const
{ {
return id; return id;
} }
UInt_64 NetOp::GetHashId() const Str_8 NetOp::GetName() const
{ {
return hashId; return name;
} }
void NetOp::Execute(NetChannel *channel, NetEnd *endpoint, NetSys *sys, Serializer<UInt_64> &payload) void NetOp::Execute(NetChannel *channel, NetEnd *endpoint, NetSys *sys, Serializer<UInt_64> &payload)

View File

@ -15,23 +15,23 @@ namespace ehs
} }
NetSys::NetSys() NetSys::NetSys()
: hashId(0) : id(0)
{ {
} }
NetSys::NetSys(Str_8 id) NetSys::NetSys(Str_8 name)
: hashId(id.Hash_64()), id((Str_8&&)id) : id(name.Hash_64()), name((Str_8&&)name)
{ {
} }
NetSys::NetSys(NetSys&& sys) noexcept NetSys::NetSys(NetSys&& sys) noexcept
: hashId(sys.hashId), id((Str_8&&)sys.id), ops((Array<NetOp*>&&)sys.ops) : id(sys.id), name((Str_8&&)sys.name), ops((Array<NetOp*>&&)sys.ops)
{ {
sys.hashId = 0; sys.id = 0;
} }
NetSys::NetSys(const NetSys& sys) NetSys::NetSys(const NetSys& sys)
: hashId(sys.hashId), id(sys.id) : id(sys.id), name(sys.name)
{ {
} }
@ -40,11 +40,11 @@ namespace ehs
if (this == &sys) if (this == &sys)
return *this; return *this;
hashId = sys.hashId; id = sys.id;
id = (Str_8&&)sys.id; name = (Str_8&&)sys.name;
ops = (Array<NetOp*>&&)sys.ops; ops = (Array<NetOp*>&&)sys.ops;
sys.hashId = 0; sys.id = 0;
return *this; return *this;
} }
@ -54,27 +54,27 @@ namespace ehs
if (this == &sys) if (this == &sys)
return *this; return *this;
hashId = sys.hashId;
id = sys.id; id = sys.id;
name = sys.name;
ops = Array<NetOp*>(); ops = Array<NetOp*>();
return *this; return *this;
} }
Str_8 NetSys::GetId() const UInt_64 NetSys::GetId() const
{ {
return id; return id;
} }
UInt_64 NetSys::GetHashId() const Str_8 NetSys::GetName() const
{ {
return hashId; return name;
} }
bool NetSys::HasOperation(const UInt_64 hashId) const bool NetSys::HasOperation(const UInt_64 id) const
{ {
for (UInt_64 i = 0; i < ops.Size(); ++i) for (UInt_64 i = 0; i < ops.Size(); ++i)
if (ops[i]->GetHashId() == hashId) if (ops[i]->GetId() == id)
return true; return true;
return false; return false;
@ -82,7 +82,7 @@ namespace ehs
bool NetSys::AddOperation(NetOp* op) bool NetSys::AddOperation(NetOp* op)
{ {
if (HasOperation(op->GetHashId())) if (HasOperation(op->GetId()))
return false; return false;
ops.Push(op); ops.Push(op);
@ -94,7 +94,7 @@ namespace ehs
{ {
for (UInt_64 i = 0; i < ops.Size(); ++i) for (UInt_64 i = 0; i < ops.Size(); ++i)
{ {
if (ops[i]->GetHashId() == hashId) if (ops[i]->GetId() == hashId)
{ {
ops[i]->Execute(channel, endpoint, this, payload); ops[i]->Execute(channel, endpoint, this, payload);
return; return;