358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
# File 'lib/manasimu/card.rb', line 358
def edges(lands, capas)
result = []
x = lands.length
i_src = 0
x.times do |i|
result << [i_src, i + 1]
end
lands.each_with_index do |land, i|
next if capas[i].to_i == 0
land_colors = land.mana_source
symbols.each_with_index do |symbol, j|
if symbol == "1" or land_colors.include? symbol
result << [i + 1, x + 1 + j]
end
end
end
y = symbols.length
i_dst = x + y + 1
y.times do |i|
result << [x + 1 + i, i_dst]
end
[x, y, result]
end
|