Trial a new resource model in cnc

This commit is contained in:
Paul Chote
2010-06-13 13:22:37 +12:00
parent 19ed7428c4
commit 640ac9b8e6
8 changed files with 112 additions and 54 deletions

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA
public void Deliver(Actor self, Actor proc)
{
proc.Owner.PlayerActor.traits.Get<PlayerResources>().GiveOre(contents.Sum(kv => kv.Key.ValuePerUnit * kv.Value));
proc.traits.Get<IAcceptOre>().GiveOre(contents.Sum(kv => kv.Key.ValuePerUnit * kv.Value));
contents.Clear();
}

View File

@@ -36,6 +36,11 @@ namespace OpenRA.Mods.RA
{
this.self = self;
}
public void GiveOre(int amount)
{
// TODO: Unbreak this
}
public int2 DeliverOffset { get { return new int2(1, 2); } }
public void OnDock(Actor harv, DeliverResources dockOrder)
{

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
@@ -25,6 +25,7 @@ namespace OpenRA.Mods.RA
public interface IAcceptOre
{
void OnDock(Actor harv, DeliverResources dockOrder);
void GiveOre(int amount);
int2 DeliverOffset { get; }
}
}