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


C# ResourceInfo.canQueue方法代码示例

本文整理汇总了C#中ResourceInfo.canQueue方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceInfo.canQueue方法的具体用法?C# ResourceInfo.canQueue怎么用?C# ResourceInfo.canQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ResourceInfo的用法示例。


在下文中一共展示了ResourceInfo.canQueue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: writeLine

        /// <summary>Escreve um item</summary>
        private void writeLine( HtmlTextWriter writer, ResourceInfo resources, string res )
        {
            if( ShowImagePreview ) {
                writer.WriteLine("<td class='resourceManagement'><img src='{0}.gif' style='width:20px;height:20px;'/></td>", OrionGlobals.getCommonImagePath(res.ToLower()));
            }

            if( ShowQuantity ) {
                writeQuantity(writer, resources, res);
            }

            writer.WriteLine("<td class='resource'>");
            if( ShowDocumentation ) {
                writer.WriteLine( "<a class='docs' href='{1}/{2}.{3}' {4}>{0}</a>",
                    info.getContent(res),
                    OrionGlobals.getSectionBaseUrl("wiki"),
                    resources.Category, res,
                    getTooltipText(resources, res)
                );
            } else {
                writer.WriteLine( info.getContent(res) );
            }

            writer.WriteLine("</td>");

            bool canBuild = resources.canQueue(res, 1).Ok;
            if( ShowCost ) {
                writeCost( writer, resources, res);
            }

            if( ShowDuration ) {
                ResourceFactory factory = (ResourceFactory) resources.AvailableFactories[res];
                int duration = QueueItem.BaseDuration(Manager, factory, 1);
                int real = QueueItem.RealDuration(Manager, factory, 1);
                if( duration == real ) {
                    writer.WriteLine("<td class='resourceCell'>{0}</td>", factory.Duration.Value);
                } else {
                    string css = "green";
                    if( real > duration ) {
                        css = "red";
                    }
                    writer.WriteLine("<td class='resourceCell'><span class='{0}'>{1}</span> ({2})</td>", css, real, duration);
                }
            }

            writeBuild( writer, resources, res, canBuild );

            if( ShowDemolish ) {
                writeDemolish( writer, res, resources );
            }
        }
开发者ID:zi-yu,项目名称:orionsbelt,代码行数:51,代码来源:Resources.cs


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