• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

samsmithnz / SatisfactoryTree / 17901817047

22 Sep 2025 01:21AM UTC coverage: 67.322% (-0.9%) from 68.215%
17901817047

Pull #312

github

web-flow
Merge 938d1164c into 6a09e2b40
Pull Request #312: Add "Add factory" button to create new factories with default naming

427 of 744 branches covered (57.39%)

Branch coverage included in aggregate %.

0 of 18 new or added lines in 2 files covered. (0.0%)

10 existing lines in 2 files now uncovered.

1149 of 1597 relevant lines covered (71.95%)

1158.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/SatisfactoryTree.Web/Services/PlanService.cs
1
using SatisfactoryTree.Logic.Models;
2

3
namespace SatisfactoryTree.Web.Services
4
{
5
    public class PlanService
6
    {
7
        private Plan? _plan;
8
        
9
        public event Action? PlanChanged;
10

11
        public Plan? Plan 
12
        { 
13
            get => _plan; 
×
14
            set 
15
            { 
×
16
                _plan = value; 
×
17
                PlanChanged?.Invoke(); 
×
18
            } 
×
19
        }
20

21
        public bool HasPlan => _plan != null && _plan.Factories.Any();
×
22

23
        public void AddFactory()
NEW
24
        {
×
NEW
25
            if (_plan == null)
×
NEW
26
            {
×
NEW
27
                _plan = new Plan();
×
NEW
28
            }
×
29

30
            // Find the next available ID
NEW
31
            int nextId = _plan.Factories.Any() ? _plan.Factories.Max(f => f.Id) + 1 : 1;
×
32
            
33
            // Create a new factory with the default name pattern
NEW
34
            string factoryName = $"Factory {nextId}";
×
NEW
35
            var newFactory = new Factory(nextId, factoryName);
×
36
            
NEW
37
            _plan.Factories.Add(newFactory);
×
NEW
38
            PlanChanged?.Invoke();
×
NEW
39
        }
×
40
    }
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc