public Mission GetMissionFromCellKey(IntVect2 key) { foreach (Mission mission in _Missions) { if (ShanghaiUtils.KeysMatch(mission.CellKey, key)) { return(mission); } } Debug.Log("ERROR, couldn't get mission from key " + key); return(null); }
public bool GenerateTarget() { IntVect2 cellKey = new IntVect2(0, 0); if (!_Model.Grid.GetRandomCell(ref cellKey)) { return(false); } ShanghaiUtils.PaintColour targetColour = ShanghaiUtils.GetRandomColour(_Model.AvailableColours); Debug.Log("targetColour: " + targetColour); float TTL = _Config.TargetWaitTime; Target target = new Target(cellKey, targetColour, TTL); Messenger <Target> .Broadcast(EVENT_TARGET_CREATED, target); return(true); }
//TODO: (CM) Should this be here? It's more like behaviour public void ChangeColour() { _PaintColour = ShanghaiUtils.GetRandomColour(_AvailableColours); Messenger <ShanghaiUtils.PaintColour> .Broadcast(EVENT_COLOUR_CHANGED, _PaintColour); }