本文整理汇总了C#中Puzzle类的典型用法代码示例。如果您正苦于以下问题:C# Puzzle类的具体用法?C# Puzzle怎么用?C# Puzzle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Puzzle类属于命名空间,在下文中一共展示了Puzzle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnExecuting
public void OnExecuting(object sender, Puzzle.SideFX.Framework.Execution.ExecutionCancelEventArgs e)
{
IEngine engine = sender as IEngine;
DisplayObjectsCommand displayObjectsCommand = DisplayObjectsCommand.Evaluate(engine, e.Command);
if (displayObjectsCommand == null)
return;
IObjectService objectService = engine.GetService<IObjectService>();
IDisplayService displayService = engine.GetService<IDisplayService>();
IDatabaseService databaseService = engine.GetService<IDatabaseService>();
databaseService.EnsureTransaction();
Type type = objectService.GetTypeByName(displayObjectsCommand.ClassName);
IList objects = null;
if (!string.IsNullOrEmpty(displayObjectsCommand.Where))
objects = objectService.GetObjects(type, displayObjectsCommand.Where);
else
objects = objectService.GetObjects(type, displayObjectsCommand.Match);
if (objects != null)
{
foreach (object obj in objects)
{
if (displayObjectsCommand.List)
displayService.List(obj);
else
displayService.Display(obj);
}
}
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:33,代码来源:DisplayObjectsDomainExecutor.cs
示例2: HandleCall
public object HandleCall(Puzzle.NAspect.Framework.MethodInvocation call)
{
Console.WriteLine("Enter");
object res= call.Proceed();
Console.WriteLine("Exit");
return res;
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:7,代码来源:MyInterceptor.cs
示例3: OnPuzzleCreate
public override void OnPuzzleCreate(Puzzle puzzle)
{
var place = puzzle.GetPlace("PuzzlePlace");
place.SpawnSingleMob("Mob1", 50002, 3); // Red Fox
place.SpawnSingleMob("Mob2", 50003, 2); // Gray Fox
}
开发者ID:aura-project,项目名称:aura,代码行数:7,代码来源:rp_chicken.cs
示例4: Construct
public void Construct(List<Puzzle> puzzles)
{
puzzles.Sort();
foreach (Puzzle puzzle in puzzles)
{
Puzzle automatedPuzzle = new Puzzle();
automatedPuzzle.Location = new System.Drawing.Point(puzzle.CoordinateX + form.Width - _image.Width - distanseBetweenControls, puzzle.CoordinateY + distanseBetweenControls);
automatedPuzzle.Size = new System.Drawing.Size(puzzle.Width, puzzle.Height);
automatedPuzzle.Width = puzzle.Width;
automatedPuzzle.Height = puzzle.Height;
automatedPuzzle.Image = puzzle.Image;
automatedPuzzle.BorderStyle = BorderStyle.Fixed3D;
automatedPuzzle.Click += new EventHandler(automatedPuzzle_Click);
if (puzzle.topPuzzle != null && puzzle.topPuzzle.Image != null)
{
automatedPuzzle.topPuzzle= SetPuzzle(automatedPuzzle.topPuzzle);
automatedPuzzle.topPuzzle.Image = puzzle.topPuzzle.Image;
smallPuzzles.SetTopPuzzleLocation(automatedPuzzle);
}
if (puzzle.rightPuzzle != null && puzzle.rightPuzzle.Image != null)
{
automatedPuzzle.rightPuzzle = SetPuzzle(automatedPuzzle.rightPuzzle);
automatedPuzzle.rightPuzzle.Image = puzzle.rightPuzzle.Image;
smallPuzzles.SetRightPuzzleLocation(automatedPuzzle);
}
form.Controls.Add(automatedPuzzle);
automatedConstructPuzzlesList.Add(automatedPuzzle);
_image.SendToBack();
}
}
开发者ID:victorKovalchuck,项目名称:Puzzles,代码行数:33,代码来源:AutoConstructPicture.cs
示例5: PuzzleAnalysis
public PuzzleAnalysis(Puzzle start)
{
Start = start;
Static = StaticAnalysis.Generate(start);
Static.DeadMap = DeadMapAnalysis.FindDeadMap(Static);
}
开发者ID:guylangston,项目名称:SokoSolve,代码行数:7,代码来源:PuzzleAnalysis.cs
示例6: SetLeftPuzzleLocation
public void SetLeftPuzzleLocation(Puzzle puzzle)
{
for (int j = 0; j < puzzle.leftPuzzle.Count; j++)
{
Point point = new Point();
if (puzzle.ImageDegree == 0)
{
point = new Point(puzzle.Location.X,
puzzle.Location.Y + puzzle.leftPuzzle[j].CoordinateY);
}
else if (puzzle.ImageDegree == 90)
{
point = new Point(puzzle.Location.X + puzzle.Size.Width - puzzle.leftPuzzle[j].CoordinateY - 10,
puzzle.Location.Y);
}
else if (puzzle.ImageDegree == 180)
{
point = new Point(puzzle.Location.X + puzzle.Size.Width - 10,
puzzle.Location.Y + puzzle.Size.Height - puzzle.leftPuzzle[j].CoordinateY-10);
}
else
{
point = new Point(puzzle.Location.X+puzzle.leftPuzzle[j].CoordinateY,
puzzle.Location.Y + puzzle.Size.Height - 10);
}
puzzle.leftPuzzle[j].Location = point;
}
}
开发者ID:victorKovalchuck,项目名称:Puzzles,代码行数:30,代码来源:SetSmallPuzzlesLocation.cs
示例7: OnMonsterDead
public override void OnMonsterDead(Puzzle puzzle, MonsterGroup group)
{
if (group.Remaining != 0)
return;
puzzle.GetPlace("Place").OpenAllDoors();
}
开发者ID:xKamuna,项目名称:aura,代码行数:7,代码来源:keychest_9chest.cs
示例8: StartPuzzle
public UnityAction StartPuzzle(Puzzle puzzle)
{
Puzzle puzzleRefCopy = puzzle;
return () =>
{
if(currentPuzzle != null)
currentPuzzle.SaveProgress();
el.ClearExampleList();
gc.SetPuzzle(puzzleRefCopy);
//puzzleRefCopy.LoadProgress();
List<Board> testedExamples = puzzleRefCopy.testedExamples;
foreach(Board board in testedExamples) {
el.AddExample(board);
}
if(!el.ContainsExample(puzzleRefCopy.example1))
el.AddExample(puzzleRefCopy.example1);
if(!el.ContainsExample(puzzleRefCopy.example2))
el.AddExample(puzzleRefCopy.example2);
ssc.SwapTo(el.GetComponent<Animator>());
currentPuzzle = puzzleRefCopy;
};
}
开发者ID:EternalGB,项目名称:Enlightenment,代码行数:26,代码来源:PuzzleList.cs
示例9: Awake
void Awake()
{
instance = this;
List<Game> GamePrefabs = new List<Game>(Resources.LoadAll<Game>("Prefabs/Games/Puzzle"));
GamePrefabs.RemoveAll(game => game.type != Game.GameType.Puzzle);
GamePrefabs.Sort(delegate(Game a, Game b)
{
return a.order.CompareTo(b.order);
});
puzzles = new List<Puzzle>();
foreach (Game game in GamePrefabs)
{
Puzzle puzzle = new Puzzle();
puzzle.name = game.name;
puzzle.stars = PlayerPrefs.GetInt(puzzle.name + "stars", 0);
if (puzzles.Count == 0) //first level is always unlocked
puzzle.unlocked = true;
else
puzzle.unlocked = PlayerPrefs.GetInt(puzzle.name + "unlocked", 0) != 0;
puzzle.prefab = game;
puzzles.Add(puzzle);
}
}
开发者ID:03knoppg,项目名称:Hextris,代码行数:26,代码来源:Progression.cs
示例10: CreateRelationship
public void CreateRelationship(CreatePropertyCommand createPropertyCommand, object sender, Puzzle.SideFX.Framework.Execution.ExecutionCancelEventArgs e)
{
IEngine engine = sender as IEngine;
ISchemaService schemaService = engine.GetService<ISchemaService>();
IDatabaseService databaseService = engine.GetService<IDatabaseService>();
string className = createPropertyCommand.ClassName;
string propertyName = createPropertyCommand.Name;
string propertyType = createPropertyCommand.Type.ToString();
string columnName = createPropertyCommand.ColumnName;
DbType columnType = DbType.Int32; //TODO: Get the column of the identity property
string tableName = schemaService.GetTableForClass(className);
switch (createPropertyCommand.Multiplicity)
{
case Multiplicity.OneToMany:
case Multiplicity.OneToOne:
//Add a property to the class
schemaService.CreateProperty(className, propertyName, propertyType);
//Set the nullability of the property
schemaService.SetPropertyMetaData(className, propertyName, PropertyMetaData.Nullable, createPropertyCommand.Nullable);
//Add a column to the table
schemaService.CreateColumn(tableName, columnName, columnType);
//Set the nullability of the column
schemaService.SetColumnMetaData(tableName, columnName, ColumnMetaData.Nullable, createPropertyCommand.Nullable);
//Map the property to the column in the schema
schemaService.MapPropertyToColumn(className, propertyName, tableName, columnName);
break;
case Multiplicity.ManyToMany:
//Add a property to the class
schemaService.CreateListProperty(className, propertyName, propertyType);
//Add a many-many table
//schemaService.CreateTable(tableName, columnName, columnType);
break;
case Multiplicity.ManyToOne:
//Add a property to the class
schemaService.CreateListProperty(className, propertyName, propertyType);
//Add a column to the table
//schemaService.CreateColumn(tableName, columnName, columnType);
break;
}
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:60,代码来源:CreatePropertySchemaExecutor.cs
示例11: HandleCall
public object HandleCall(Puzzle.NAspect.Framework.MethodInvocation call)
{
Console.WriteLine("entering {0}", call.ValueSignature);
object res = call.Proceed();
Console.WriteLine("exiting {0} and returning '{1}'", call.ValueSignature,res);
return res;
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:7,代码来源:SampleInterceptor.cs
示例12: test
public static void test( Puzzle initial, String proconFormat )
{
String[] lines = proconFormat.Split( new string[]{Environment.NewLine}, StringSplitOptions.None);
int choiceCount = int.Parse( lines[0] );
for( int i = 0; i < choiceCount; i++ )
{
String pos = lines[1 + i * 3];
int moveCount = int.Parse(lines[2 + i * 3]);
int blankColumn = int.Parse(pos[0].ToString(), System.Globalization.NumberStyles.AllowHexSpecifier) + 1;
int blankRow = int.Parse(pos[1].ToString(), System.Globalization.NumberStyles.AllowHexSpecifier) + 1;
int blank = initial[blankColumn,blankRow];
initial.Choice(blank);
for( int j = 0; j < moveCount; j++ )
{
Puzzle.Position move = initial.CharToPosition(lines[(i + 1) * 3][j]);
if (!initial.DoMove(move))
throw new Exception();
}
}
Console.WriteLine();
for (int i = 1; i <= Problem.row; i++)
{
for (int j = 1; j <= Problem.column; j++)
{
Console.Write(initial.Data[initial.CoordToPosition(j, i)] + "\t");
}
Console.WriteLine();
}
}
开发者ID:solismb,项目名称:procon25,代码行数:30,代码来源:y1r.cs
示例13: OnPuzzleCreate
public override void OnPuzzleCreate(Puzzle puzzle)
{
var place = puzzle.GetPlace("PuzzlePlace");
place.SpawnSingleMob("Mob1", 120006, 3); // Young Country Rat
place.SpawnSingleMob("Mob2", 30005, 8); // White Spiderling
}
开发者ID:aura-project,项目名称:aura,代码行数:7,代码来源:rp_giantspider.cs
示例14: Start
// Use this for initialization
void Start()
{
progress = 0;
uiManager = GameObject.FindObjectOfType<UIManager>();
if (initialPuzzleIndex >= 0)
{
List<Puzzle> puzzleSet = new List<Puzzle>(puzzlesPrefabs.ToArray());
for (int i = 0; i < puzzleCount + remainingFailures; i++)
{
puzzlesToComplete.Add(puzzleSet[initialPuzzleIndex]);
}
currentPuzzle = SpawnPuzzle(puzzlesPrefabs[initialPuzzleIndex]);
}
else
{
List<Puzzle> puzzleSet = new List<Puzzle>(puzzlesPrefabs.ToArray());
for (int i = 0; i < puzzleCount + remainingFailures; i++)
{
int puzzleIndex = Random.Range(0, puzzleSet.Count);
puzzlesToComplete.Add(puzzleSet[puzzleIndex]);
puzzleSet.RemoveAt(puzzleIndex);
if (puzzleSet.Count == 0)
puzzleSet = new List<Puzzle>(puzzlesPrefabs.ToArray());
}
currentPuzzle = SpawnPuzzle(puzzlesToComplete[progress]);
}
SetupCurrentPuzzle();
Run();
}
开发者ID:FourSwordKirby,项目名称:GGJ-2016,代码行数:32,代码来源:PuzzleManager.cs
示例15: run
public static String run(int[,] map2d)
{
// y1r-Solverは2xM, Nx2のパズルには対応していないため,
// この時は横長, 縦長に強いSolver1を流用する
if (Problem.row == 2 || Problem.column == 2)
{
return Solver1.run(map2d);
}
int[] puzzle = new int[Problem.partNum];
for (int i = 0; i < Problem.row; i++)
for (int j = 0; j < Problem.column; j++)
puzzle[i * Problem.column + j] = map2d[i, j];
Puzzle initial = new Puzzle( puzzle, Problem.column, Problem.row, Problem.selectionLimit, Problem.selectionCost, Problem.replacementCost);
PuzzleSolver solver = new PuzzleSolver(initial, initial);
solver.Solve();
// test(initial, solver.Puzzle.GetSolution());
Puzzle miniMap = solver.Puzzle;
return MiniPuzzleSolver.Solve(miniMap);
}
开发者ID:solismb,项目名称:procon25,代码行数:25,代码来源:y1r.cs
示例16: CreateListProxy
public Puzzle.NPersist.Framework.Interfaces.IInterceptableList CreateListProxy(Type baseType, Puzzle.NPersist.Framework.Persistence.IObjectFactory objectFactory, params object[] ctorArgs)
{
// return Puzzle.NPersist.Framework.Proxy.ListProxyFactory.CreateProxy(baseType,objectFactory,ctorArgs) ;
if (baseType == typeof(IInterceptableList) || baseType == typeof(InterceptableList) || baseType == typeof(IList))
{
baseType = typeof(InterceptableList);
return (Puzzle.NPersist.Framework.Interfaces.IInterceptableList) context.ObjectFactory.CreateInstance(baseType,ctorArgs);
}
#if NET2
else if (baseType.IsGenericType && baseType.IsInterface)
{
Type subType = baseType.GetGenericArguments ()[0];
Type genericType = typeof(InterceptableGenericsList<>).MakeGenericType(subType);
return (Puzzle.NPersist.Framework.Interfaces.IInterceptableList) context.ObjectFactory.CreateInstance(genericType,ctorArgs);
}
#endif
else
{
Type proxyType = aopEngine.CreateProxyType(baseType) ;
object[] proxyArgs = aopEngine.AddStateToCtorParams(context,ctorArgs);
return (Puzzle.NPersist.Framework.Interfaces.IInterceptableList) context.ObjectFactory.CreateInstance(proxyType,proxyArgs);
//return Puzzle.NPersist.Framework.Proxy.ListProxyFactory.CreateProxy(baseType,objectFactory,ctorArgs) ;
}
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:27,代码来源:AopProxyFactory.cs
示例17: FindPath
public void FindPath()
{
var textPuzzle = new Puzzle(new string[]
{
"~~~###~~~~~",
"~~## #~####",
"~##e ### #",
"## X #",
"# X # #",
"### X### #",
"~~# # #",
"~## ## # ##",
"~# s ##~",
"~# ##~~",
"~#######~~~",
});
var boundry = textPuzzle.ToMap('#', 'X');
var start = textPuzzle.Where(x=>x=='s').First().Position;
var end = textPuzzle.Where(x=>x=='e').First().Position;
var result = PathFinder.Find(boundry, start, end);
Assert.That(result, Is.Not.Null);
Assert.That(result.ToString(), Is.EqualTo("LLUUUURUUL"));
}
开发者ID:guylangston,项目名称:SokoSolve,代码行数:28,代码来源:PathFinderTests.cs
示例18: InitOnceBeforeAnyTest
public void InitOnceBeforeAnyTest()
{
puzzle = new Puzzle(6, 5, new List<byte> {0, 1, 3}, new List<byte> {1, 2}, new List<byte> {3, 4}, true);
expected = new Puzzle(6, 5, new List<byte> {0, 1, 3}, new List<byte> {1, 2}, new List<byte> {3, 4}, true);
solvedUpperPosition = new byte[,] {{6, 6, 7, 6, 7}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {0, 0, 7, 0, 7}};
solvedLowerPosition = new byte[,] {{0, 0, 7, 0, 7}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {6, 6, 7, 6, 7}};
}
开发者ID:clagoos,项目名称:colorful-cylinder-puzzle,代码行数:7,代码来源:PuzzleMoveTests.cs
示例19: OnPrepare
public override void OnPrepare(Puzzle puzzle)
{
var lockedPlace = puzzle.NewPlace("LockedPlace");
lockedPlace.DeclareLockSelf();
lockedPlace.ReservePlace();
}
开发者ID:aura-project,项目名称:aura,代码行数:7,代码来源:ghostarmor_darklord.cs
示例20: Box
public void Box()
{
// Init
var report = new TestReport();
var puz = new Puzzle(new String[]
{
"#####",
"#...#",
"#...#",
"#...#",
"#####",
});
var stat = StaticAnalysis.Generate(puz);
var dead = DeadMapAnalysis.FindDeadMap(stat);
Assert.That(dead, Is.Not.Null);
report.WriteLine(dead);
Assert.That(report, Is.EqualTo(new TestReport(
@".....
.XXX.
.X.X.
.XXX.
....."
)));
}
开发者ID:guylangston,项目名称:SokoSolve,代码行数:28,代码来源:DeadMapAnalysisTests.cs
注:本文中的Puzzle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论