Come collision stuff and stuff aand stuff hahahah
This commit is contained in:
@@ -1,31 +1,57 @@
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class base_building : Node3D
|
||||
{
|
||||
[Export]
|
||||
public Node3D BlocksNode { get; set; } = null;
|
||||
private building_block[] _blocks = null;
|
||||
private List<building_block> _blocks = null;
|
||||
|
||||
[Export]
|
||||
public string DisplayName { get; set; } = "base_building";
|
||||
[Export]
|
||||
public int KashCost { get; set; } = 1;
|
||||
public bool IsPlaced { get; set; } = false;
|
||||
|
||||
public bool IsPlaceable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
if (_blocks == null || _blocks.Count < 1)
|
||||
return false;
|
||||
|
||||
foreach (building_block block in _blocks)
|
||||
if (!block.IsPlaceable)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (BlocksNode != null)
|
||||
{
|
||||
|
||||
_blocks = new List<building_block>();
|
||||
foreach (Node child in BlocksNode.GetChildren())
|
||||
{
|
||||
_blocks.Add((building_block)child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
// if (!IsPlaced)
|
||||
//{
|
||||
//if (IsPlaceable)
|
||||
//{
|
||||
////show green highlight
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
////show red highlight
|
||||
//}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user