You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
567 B

2 years ago
using Flyweight.Objects;
using Newtonsoft.Json;
using System;
2 years ago
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Flyweight.Flyweights
{
internal class Flyweight
{
2 years ago
private Car _sharedState;
2 years ago
2 years ago
public Flyweight(Car car)
{
_sharedState = car;
}
public void Operation(Car uniqueState)
{
string s = JsonConvert.SerializeObject(_sharedState);
string u = JsonConvert.SerializeObject(uniqueState);
Console.WriteLine($"Flyweight: Displaying shared {s} and unique {u} state.");
}
2 years ago
}
}