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);
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:
friend class NetSys;
UInt_64 hashId;
Str_8 id;
UInt_64 id;
Str_8 name;
public:
virtual ~NetOp() = default;
NetOp();
NetOp(Str_8 id);
NetOp(Str_8 name);
NetOp(NetOp &&op) noexcept;
@ -32,9 +32,9 @@ namespace ehs
NetOp &operator=(const NetOp &op);
Str_8 GetId() const;
UInt_64 GetId() const;
UInt_64 GetHashId() const;
Str_8 GetName() const;
private:
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 NetClientCh;
UInt_64 hashId;
Str_8 id;
UInt_64 id;
Str_8 name;
Array<NetOp*> ops;
public:
@ -26,7 +26,7 @@ namespace ehs
NetSys();
NetSys(Str_8 id);
NetSys(Str_8 name);
NetSys(NetSys &&sys) noexcept;
@ -36,15 +36,15 @@ namespace ehs
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);
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)
{
if (sys->GetHashId() == internalSys)
if (sys->GetId() == internalSys)
return false;
if (HasSystem(sys->GetHashId()))
if (HasSystem(sys->GetId()))
return false;
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)
if (systems[i]->GetHashId() == sysHashId)
if (systems[i]->GetId() == sysId)
return true;
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)
if (systems[i]->GetHashId() == sysHashId)
if (systems[i]->GetId() == sysId)
return systems[i];
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
{
NetOp::NetOp()
: hashId(0)
: id(0)
{
}
NetOp::NetOp(Str_8 id)
: hashId(id.Hash_64()), id((Str_8 &&)id)
NetOp::NetOp(Str_8 name)
: id(name.Hash_64()), name((Str_8 &&)name)
{
}
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)
: hashId(op.hashId), id(op.id)
: id(op.id), name(op.name)
{
}
@ -30,10 +30,10 @@ namespace ehs
if (this == &op)
return *this;
hashId = op.hashId;
id = (Str_8 &&)op.id;
id = op.id;
name = (Str_8 &&)op.name;
op.hashId = 0;
op.id = 0;
return *this;
}
@ -43,20 +43,20 @@ namespace ehs
if (this == &op)
return *this;
hashId = op.hashId;
id = op.id;
name = op.name;
return *this;
}
Str_8 NetOp::GetId() const
UInt_64 NetOp::GetId() const
{
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)

View File

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