Move Player logic to other project
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace Zennysoft.Game.Ma;
|
using System.Numerics;
|
||||||
|
|
||||||
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -10,5 +12,7 @@ public partial class PlayerLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
public readonly record struct ThrowItem;
|
public readonly record struct ThrowItem;
|
||||||
|
|
||||||
|
public readonly record struct Move(float delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Chickensoft.LogicBlocks;
|
using Chickensoft.LogicBlocks;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Chickensoft.LogicBlocks;
|
using Chickensoft.LogicBlocks;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public interface IPlayerLogic : ILogicBlock<PlayerLogic.State>;
|
public interface IPlayerLogic : ILogicBlock<PlayerLogic.State>;
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -13,8 +13,7 @@ public partial class PlayerLogic
|
|||||||
public virtual Transition On(in Input.PhysicsTick input)
|
public virtual Transition On(in Input.PhysicsTick input)
|
||||||
{
|
{
|
||||||
var delta = input.Delta;
|
var delta = input.Delta;
|
||||||
var player = Get<IPlayer>();
|
Output(new Output.Move((float)delta));
|
||||||
player.Move((float)delta);
|
|
||||||
return ToSelf();
|
return ToSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Zennysoft.Game.Abstractions;
|
using Zennysoft.Game.Abstractions;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma.Implementation;
|
||||||
|
|
||||||
public partial class PlayerLogic
|
public partial class PlayerLogic
|
||||||
{
|
{
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Chickensoft.GodotNodeInterfaces;
|
using Chickensoft.Introspection;
|
||||||
using Chickensoft.Introspection;
|
|
||||||
using Chickensoft.Serialization;
|
using Chickensoft.Serialization;
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace Zennysoft.Game.Ma;
|
|
||||||
public partial class MapLogic
|
|
||||||
{
|
|
||||||
public static class Input
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bn0l0ur7ih0ea
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using Chickensoft.Introspection;
|
|
||||||
using Chickensoft.LogicBlocks;
|
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
|
||||||
|
|
||||||
public partial class MapLogic
|
|
||||||
{
|
|
||||||
[Meta]
|
|
||||||
public partial record State : StateLogic<State>
|
|
||||||
{
|
|
||||||
public State()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bf2bas1ky7ae1
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using Chickensoft.Introspection;
|
|
||||||
using Chickensoft.LogicBlocks;
|
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
|
||||||
|
|
||||||
public interface IMapLogic : ILogicBlock<MapLogic.State>;
|
|
||||||
|
|
||||||
[Meta]
|
|
||||||
[LogicBlock(typeof(State))]
|
|
||||||
public partial class MapLogic : LogicBlock<MapLogic.State>, IMapLogic
|
|
||||||
{
|
|
||||||
public override Transition GetInitialState() => To<State>();
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dhjrhbhvpduqn
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.GodotNodeInterfaces;
|
using Chickensoft.GodotNodeInterfaces;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
using Zennysoft.Game.Ma;
|
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Zennysoft.Game.Ma;
|
namespace Zennysoft.Game.Ma;
|
||||||
|
|||||||
@@ -209,6 +209,10 @@ public partial class Player : CharacterBody3D, IPlayer
|
|||||||
})
|
})
|
||||||
.Handle((in PlayerLogic.Output.ThrowItem output) =>
|
.Handle((in PlayerLogic.Output.ThrowItem output) =>
|
||||||
{
|
{
|
||||||
|
})
|
||||||
|
.Handle((in PlayerLogic.Output.Move output) =>
|
||||||
|
{
|
||||||
|
Move(output.delta);
|
||||||
});
|
});
|
||||||
|
|
||||||
GameChunk.AddChunk(PlayerChunk);
|
GameChunk.AddChunk(PlayerChunk);
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
uid://ch6oc0relbray
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cylnjf8jadgo6
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cmbt77ty7pmvc
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://c46w8aytsajoe
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://beqr05mbwbg3b
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dyrl0x5q3q5j7
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://i0g8tve28n70
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://demor6ic4xcwn
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bsxp82sus11pv
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://pbj8nbyp8iwr
|
|
||||||
Reference in New Issue
Block a user