Moved scripts to namespaces

This commit is contained in:
Фёдор Веселов 2024-09-29 15:06:51 +05:00
commit de2c6261b0
51 changed files with 128 additions and 29 deletions

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon;
public partial class Cursor : Node
{
public static Cursor Instance { get; private set; }

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon;
//
// Button that contains level to load
//

View file

@ -1,5 +1,7 @@
using Godot;
namespace Newlon;
//
// Class that gives access to level data, pools and etc.
//

View file

@ -1,5 +1,8 @@
using Godot;
using System;
using Newlon.Components.Level;
namespace Newlon;
public partial class Sun : Area2D
{

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon;
//
// Class for general-used constants and utility tools
//

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon.Components;
public partial class FlashComponent : CanvasGroup
{
[Export] private float _flashDuration = 0.1f;

View file

@ -1,3 +1,5 @@
namespace Newlon.Components;
//
// Base interface for entities
//

View file

@ -1,3 +1,5 @@
namespace Newlon.Components;
//
// Base interface for entities
//

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon.Components;
public partial class LevelGUIElements : Control
{
public static LevelGUIElements Instance;

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon.Components;
//
// Projectile that travels from left to right
//

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.GUI;
public partial class FastForwardButton : Button
{

View file

@ -1,5 +1,8 @@
using Godot;
using System;
using Newlon.Components.Plants;
using Newlon.Components.Level;
namespace Newlon.Components.GUI;
public partial class ShovelButton : TextureButton
{

View file

@ -1,5 +1,7 @@
using Godot;
using System;
using Newlon.Components.Level;
namespace Newlon.Components.GUI;
public partial class SunCounter : Label
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.GUI;
public partial class VeilResizer : TextureProgressBar
{

View file

@ -1,5 +1,7 @@
using Godot;
using System;
using Newlon.Components.GUI.Seedpackets;
namespace Newlon.Components.GUI;
public partial class GridLoader : GridContainer
{

View file

@ -1,4 +1,7 @@
using Godot;
using Newlon.Components.Level;
namespace Newlon.Components.GUI;
public partial class LevelRunButton : Button
{

View file

@ -1,3 +1,5 @@
namespace Newlon.Components.GUI.Seedpackets;
public class ChoosableHandler : SeedpacketHandler, ISeedpacketPress
{
public ChoosableHandler(Seedpacket owner) : base(owner)

View file

@ -1,5 +1,7 @@
using System;
using Godot;
using Newlon.Components.Level;
namespace Newlon.Components.GUI.Seedpackets;
public class HotbarHandler : SeedpacketHandler, ISeedpacketPress, ISeedpacketProcess, ISeedpacketUnfocus
{
public HotbarHandler(Seedpacket owner) : base(owner)

View file

@ -1,5 +1,8 @@
using System;
using Godot;
using Newlon.Components.Level;
namespace Newlon.Components.GUI.Seedpackets;
public class HotbarPregameHandler : SeedpacketHandler, ISeedpacketPress
{
public HotbarPregameHandler(Seedpacket owner) : base(owner)

View file

@ -1,3 +1,5 @@
namespace Newlon.Components.GUI.Seedpackets;
public interface ISeedpacketPress
{
public void Pressed();

View file

@ -1,3 +1,5 @@
namespace Newlon.Components.GUI.Seedpackets;
public interface ISeedpacketProcess
{
public void Process();

View file

@ -1,3 +1,5 @@
namespace Newlon.Components.GUI.Seedpackets;
public interface ISeedpacketUnfocus
{
public void OnUnfocused();

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.GUI.Seedpackets;
public partial class Seedpacket : TextureButton
{

View file

@ -1,3 +1,5 @@
namespace Newlon.Components.GUI.Seedpackets;
public class SeedpacketHandler
{
protected Seedpacket _owner;

View file

@ -1,4 +1,8 @@
using Godot;
using Newlon.Components.GUI.Seedpackets;
using Newlon.Components.Plants;
namespace Newlon.Components.Level;
public partial class PlantField : Node2D
{
@ -64,7 +68,7 @@ public partial class PlantField : Node2D
if (canPlace)
_plantSetter.GlobalPosition = expected_pos;
_plantSetter.Texture = _resource == null ? null : _resource.Preview;
_plantSetter.Texture = _resource?.Preview;
}
public override void _UnhandledInput(InputEvent @event)

View file

@ -1,6 +1,8 @@
using Godot;
using System.Collections.Generic;
namespace Newlon.Components.Level;
//
// PoolContainer contains nodes that contain different elemnts that generate during runtime
// Is not pool in traditional sense, but named like that to prevent repetition

View file

@ -1,6 +1,7 @@
using System;
using Godot;
//using Godot.Collections;
namespace Newlon.Components.Level;
public partial class RuntimeLevelData : Node
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Level;
public partial class SunSpawner : Node
{

View file

@ -1,5 +1,7 @@
using Godot;
using System;
using Newlon.Components.Zombies;
namespace Newlon.Components.Plants;
public partial class AreaAttack : Area2D
{

View file

@ -1,4 +1,7 @@
using Godot;
using Newlon.Components.Zombies;
namespace Newlon.Components.Plants;
public partial class ExplosionComponent : Area2D
{

View file

@ -1,6 +1,8 @@
using Godot;
using System.Collections.Generic;
namespace Newlon.Components.Plants;
public partial class Eyesight : Area2D
{
private bool _enemyDetected;

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Plants;
public partial class PlantEyesightLimiter : CollisionShape2D
{

View file

@ -1,5 +1,7 @@
using Godot;
using System;
using Newlon.Components.Level;
namespace Newlon.Components.Plants;
public partial class PlantSunSpawner : Node2D
{

View file

@ -1,5 +1,7 @@
using Godot;
using System;
using Newlon.Components.Level;
namespace Newlon.Components.Plants;
//
// Data that plant stores during runtime

View file

@ -1,4 +1,7 @@
using Godot;
using Newlon.Components.Level;
namespace Newlon.Components.Plants;
// Shoot component of some plants
public partial class Shooter : Node2D

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Plants.Behaviours;
public partial class PeashooterBehaviour : Node
{

View file

@ -1,5 +1,7 @@
using Godot;
namespace Newlon.Components.Plants.Behaviours;
public partial class PotatomineBehaviour : Node
{
[Export] private AnimationPlayer _player;

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Plants.Behaviours;
public partial class SpikeweedBehaviour : Node
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Plants.Behaviours;
public partial class SunflowerBehaviour : Node
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Plants.Behaviours;
public partial class WallnutBehaviour : Node
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Zombies;
public partial class AudioDamage : AudioStreamPlayer2D
{

View file

@ -1,5 +1,8 @@
using Godot;
using System;
using Newlon.Components.Plants;
namespace Newlon.Components.Zombies;
public partial class EatBox : Area2D
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Zombies;
public partial class RuntimeZombieData : Node2D, IEntity
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Zombies;
public partial class ZombieMover : Node
{

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon.Components.Zombies.Behaviours;
public partial class BasicZombieBehaviour : Node
{

View file

@ -1,5 +1,8 @@
using Godot;
using System;
using Newlon.Components.Level;
namespace Newlon.Debug;
public partial class Cheats : Node
{

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon.Debug;
//
// Debug tool to check time since clock loaded
//

View file

@ -1,5 +1,6 @@
using Godot;
using System;
namespace Newlon;
[GlobalClass]
public partial class PlantResource : Resource

View file

@ -1,6 +1,8 @@
using Godot;
using System;
namespace Newlon.Systems.Effects;
public abstract partial class Effect : Resource
{
public abstract void Enter();

View file

@ -0,0 +1,6 @@
namespace Newlon.Systems.Effects;
public interface IEffectHandler
{
}