Re-organize all projects (#4166)
This commit is contained in:
55
Content.Server/Transform/Verbs/AttachToGrandparentVerb.cs
Normal file
55
Content.Server/Transform/Verbs/AttachToGrandparentVerb.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Content.Shared.Transform;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.Transform.Verbs
|
||||
{
|
||||
[GlobalVerb]
|
||||
public class AttachToGrandparentVerb : GlobalVerb
|
||||
{
|
||||
public override void GetData(IEntity user, IEntity target, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (user == target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.PlayerSession, "attachtograndparent"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("Attach to grid");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
}
|
||||
|
||||
public override void Activate(IEntity user, IEntity target)
|
||||
{
|
||||
if (!user.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.PlayerSession, "attachtograndparent"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Transform.AttachToGrandparent();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Content.Server/Transform/Verbs/AttachToGridVerb.cs
Normal file
54
Content.Server/Transform/Verbs/AttachToGridVerb.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.Transform.Verbs
|
||||
{
|
||||
[GlobalVerb]
|
||||
public class AttachToGridVerb : GlobalVerb
|
||||
{
|
||||
public override void GetData(IEntity user, IEntity target, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (user == target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.PlayerSession, "attachtogrid"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("Attach to grid");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
}
|
||||
|
||||
public override void Activate(IEntity user, IEntity target)
|
||||
{
|
||||
if (!user.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.PlayerSession, "attachtogrid"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Transform.AttachToGridOrMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Content.Server/Transform/Verbs/AttachToSelf.cs
Normal file
54
Content.Server/Transform/Verbs/AttachToSelf.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.Transform.Verbs
|
||||
{
|
||||
[GlobalVerb]
|
||||
public class AttachToSelf : GlobalVerb
|
||||
{
|
||||
public override void GetData(IEntity user, IEntity target, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (user == target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.PlayerSession, "attachtoself"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("Attach to self");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
}
|
||||
|
||||
public override void Activate(IEntity user, IEntity target)
|
||||
{
|
||||
if (!user.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.PlayerSession, "attachtoself"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Transform.AttachParent(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user