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,6 @@
[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"] [gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"]
[ext_resource type="Script" path="res://scripts/LinearProjectile.cs" id="1_3kc4s"] [ext_resource type="Script" path="res://scripts/components/LinearProjectile.cs" id="1_3kc4s"]
[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"] [ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"] [sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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