当前位置: 首页>>代码示例>>Java>>正文


Java RoundDelta类代码示例

本文整理汇总了Java中battlecode.serial.RoundDelta的典型用法代码示例。如果您正苦于以下问题:Java RoundDelta类的具体用法?Java RoundDelta怎么用?Java RoundDelta使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RoundDelta类属于battlecode.serial包,在下文中一共展示了RoundDelta类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOutput

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public List<Object> getOutput() {
    // Copy data
    ArrayList<Object> output = new ArrayList<Object>(data);

    // Insert awesomeness stats into RoundDelta
    int statNum = 0;
    for (ListIterator<Object> iter = output.listIterator(); iter.hasNext(); ) {
        Object round = iter.next();
        if (round instanceof RoundDelta) {
            RoundDelta rd = (RoundDelta) round;
            //iter.add(stats.get(statNum++));
            //Signal[] oldSignals = rd.getSignals();
            Signal[] oldSignals = stripIndicatorStrings(rd.getSignals());
            final int len = oldSignals.length;
            Signal[] newSignals = new Signal[len + 1];
            System.arraycopy(oldSignals, 0, newSignals, 1, len);
            newSignals[0] = stats.get(statNum++);
            rd.setSignals(newSignals);
        }
    }

    return output;
}
 
开发者ID:jaaso,项目名称:battlecode-2013-server,代码行数:24,代码来源:AwesomenessAnalyzer.java

示例2: unmarshal

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public Object unmarshal(HierarchicalStreamReader reader,
                        UnmarshallingContext context) {
    RoundDelta rd = new RoundDelta();
    rd.setInternalSignals((InternalSignal[]) context.convertAnother
            (rd, InternalSignal[].class));
    return rd;
}
 
开发者ID:battlecode,项目名称:battlecode-server-2016,代码行数:8,代码来源:XStreamSerializerFactory.java

示例3: apply

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public synchronized void apply(RoundDelta rd) {
    preUpdateRound();
    for (InternalSignal internalSignal : rd.getInternalSignals()) {
        visitSignal(internalSignal);
    }
    postUpdateRound();
}
 
开发者ID:battlecode,项目名称:battlecode-client-2016,代码行数:8,代码来源:GameState.java

示例4: addData

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public void addData(Object o) {
    data.add(o);

    if (o instanceof MatchHeader) {
        visitHeader((MatchHeader) o);
        System.out.println("Center: " + centerX + " " + centerY + " " + radius);
    } else if (o instanceof RoundDelta) {
        stats.add(visitRound((RoundDelta) o));
    }
}
 
开发者ID:jaaso,项目名称:battlecode-2013-server,代码行数:11,代码来源:AwesomenessAnalyzer.java

示例5: canConvert

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public boolean canConvert(Class cls) {
    return cls.equals(RoundDelta.class);
}
 
开发者ID:battlecode,项目名称:battlecode-server-2016,代码行数:4,代码来源:XStreamSerializerFactory.java

示例6: marshal

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public void marshal(Object value, HierarchicalStreamWriter writer,
                    MarshallingContext context) {
    context.convertAnother(((RoundDelta) value).getInternalSignals());
}
 
开发者ID:battlecode,项目名称:battlecode-server-2016,代码行数:5,代码来源:XStreamSerializerFactory.java

示例7: applyDelta

import battlecode.serial.RoundDelta; //导入依赖的package包/类
private void applyDelta(E gs, RoundDelta delta) {
    long startTime = System.nanoTime();
    gs.apply(delta);
    applyTime += (System.nanoTime() - startTime);
    numApplies++;
}
 
开发者ID:battlecode,项目名称:battlecode-client-2016,代码行数:7,代码来源:GameStateTimeline.java

示例8: marshal

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public void marshal(Object value, HierarchicalStreamWriter writer,
                    MarshallingContext context) {
    context.convertAnother(((RoundDelta) value).getSignals());
}
 
开发者ID:jaaso,项目名称:battlecode-2013-server,代码行数:5,代码来源:XStreamProxy.java

示例9: unmarshal

import battlecode.serial.RoundDelta; //导入依赖的package包/类
public Object unmarshal(HierarchicalStreamReader reader,
                        UnmarshallingContext context) {
    RoundDelta rd = new RoundDelta();
    rd.setSignals((Signal[]) context.convertAnother(rd, Signal[].class));
    return rd;
}
 
开发者ID:jaaso,项目名称:battlecode-2013-server,代码行数:7,代码来源:XStreamProxy.java

示例10: writeRound

import battlecode.serial.RoundDelta; //导入依赖的package包/类
/**
 * Writes round data to the recipient.
 *
 * @param data the round data bytes to write
 * @throws IOException if the recipient could not be written to
 */
public void writeRound(RoundDelta round) throws IOException {
    writeObject(round);
}
 
开发者ID:jaaso,项目名称:battlecode-2013-server,代码行数:10,代码来源:Proxy.java


注:本文中的battlecode.serial.RoundDelta类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。