public void SwitchState(IGathererState state) { if (CurrentState.GetType() == state.GetType()) { return; } CurrentState = state; }
public Gatherer(int food, List <ResourceAmount> allProducts, List <ResourceAmount> initialProducts) : base(food, initialProducts) { AllProducts = allProducts.Select(p => new ResourceAmount(p.Type, p.Amount)).ToList(); CurrentState = new FreeState(); }