package org.example.facade;
public class Class1 {
public void method1()
{
}
}
package org.example.facade;
public class Class2 {
public void method2()
{
}
}
package org.example.facade;
public class Facade {
Class1 class1;
Class2 class2;
public Facade()
{
class1 = new Class1();
class2 = new Class2();
}
public void function()
{
class1.method1();
class2.method2();
}
}
package org.example.facade;
public class Main {
public static void main(String[] args)
{
Facade facade = new Facade();
facade.function();
}
}
package org.example.decorator;
public class ConcreteDecorator extends Decorator {
protected ConcreteDecorator(Component component) {
super(component);
}
@Override
public void method1() {
}
@Override
public void method2() {
}
}
package org.example.decorator;
public class Main {
public static void main(String[] args)
{
Component component = new ConcreteComponent();
Component instance = new ConcreteDecorator(component);
instance.method1();
instance.method2();
Component component1 = new ConcreteDecorator(new ConcreteDecorator(component));
component1.method1();
component1.method2();
}
}
// マップの配置
foreach (var c in gameData.Battle.GetAliveCityList())
{
var maps = c.GetMaps();
foreach (var m in maps)
{
m.AddLayer(layer);
}
}
ここは前回と変わらず。
ただ、表示する■のサイズや座標の計算処理は変えています。
そして、その都市同士のリンクを示す選も描画していきます。
// リンクの描画
for (int i = 1; i <= gameData.MapData.citydata.Length; i++)
{
var m = Singleton.FieldMap.GetMap(i);
foreach (var linkedMap in m.GetLinkdMap())
{
if(m.Id < linkedMap.Id)
{
var geometryObject = new asd.GeometryObject2D();
geometryObject.Color = new asd.Color(0, 0, 255);
geometryObject.DrawingPriority = 5;
var linkLine = new asd.LineShape();
linkLine.StartingPosition = new asd.Vector2DF(m.CenterX, m.CenterY);
linkLine.EndingPosition = new asd.Vector2DF(linkedMap.CenterX, linkedMap.CenterY);
linkLine.Thickness = 2;
geometryObject.Shape = linkLine;
layer.AddObject(geometryObject);
}
}
}