Esempio n. 1
0
    public override void _Process(float delta)
    {
        if (_currentlyPlacingBuilding == null)
        {
            return;
        }

        var canPlace = CanPlace(_currentlyPlacingBuilding);

        if (canPlace)
        {
            _placementMarker.SetAllow();
        }
        else
        {
            _placementMarker.SetDeny();
        }

        if (Input.IsActionJustPressed("accept_build") && canPlace)
        {
            _placementMarker.QueueFree();
            _placementMarker = null;
            AddBuilding(_currentlyPlacingBuilding);
            _currentlyPlacingBuilding.Build();
            SetBuildPlaceHolder(_currentlyPlacingBuilding.BuildingType);
        }
    }
Esempio n. 2
0
        static void buildBuilding(string name, double latitude, double longitude)
        {
            IBuilding building = factory.GetBuilding(name);

            building.Build(latitude, longitude);
        }