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

samsmithnz / SatisfactoryTree / 17921088027

22 Sep 2025 03:59PM UTC coverage: 67.461% (-0.8%) from 68.215%
17921088027

Pull #312

github

web-flow
Merge a5e8f3799 into 9b5cf3f1d
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%)

1 existing line in 1 file now uncovered.

1159 of 1607 relevant lines covered (72.12%)

1152.12 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